FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour change function cTempFile
Posts: 181
Joined: Thu Apr 17, 2008 02:38 PM
change function cTempFile
Posted: Wed Sep 28, 2011 04:13 PM
Hi to all,

Is possible to change in std mode the function "cTempFile" in this way ?
Code (fw): Select all Collapse
function cTempFile( cPath, cExtension )        // returns a temporary filename

   local cFileName

   static cOldName

   DEFAULT cPath := "", cExtension := ""
   
   if .not. empty(cExtension)  <----- New
      if ! "." $ cExtension
         cExtension = "." + cExtension
      endif   
   endif  <--- New 

   while File( cFileName := ( cPath + LTrim( Str( GetTickCount() ) ) + cExtension ) ) .or. ;
      cFileName == cOldName
   end

   cOldName = cFileName

return cFileName


Thank

Continue the discussion