FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index Bugs report & fixes / Informe de errores y arreglos Much faster cTempFile() function
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Much faster cTempFile() function
Posted: Sat Apr 08, 2006 08:38 PM
FWH April users may change this function to get much faster printing previews:
function cTempFile( cPath, cExtension )        // returns a temporary filename

   local cFileName

   static cOldName

   DEFAULT cPath := "", cExtension := ""
   
   if ! "." $ cExtension
      cExtension = "." + cExtension
   endif   

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

   cOldName = cFileName

return cFileName
regards, saludos

Antonio Linares
www.fivetechsoft.com

Continue the discussion