I see some WRITELINE's, and CLOSE's that need to be silenced.
Please see the manual as well as the FAQ. If the manual stated that the function returns a value then you need to catch it in a variable.
WriteLine( )
Action: Appends a line to the end of the file indicated by File Number. If WriteLine encounters an error, @ERROR is set to the relevant error code.
Syntax: WriteLine (FileHandle, “LineToWrite”)
Parameters: FileHandle
A numeric expression indicating the handle number of the file to open. Possible values range from 1 to 10.
LineToWrite
The string you want to write to the file.
Remarks: WriteLine does not automatically append a <Carriage Return> and <Line Feed>, so if you want to write this, you should add it to the string, as in: $LineToWrite + @CRLF.
Returns: -4 File not open for writing
-3 File number not open
-2 Invalid file number specified
-1 End of file
0 Line written successfully
See Also: Close( ), FreeFileHandle( ), Open( ), ReadLine( ), ReadProfileString( ), WriteProfileString( )
Example: IF Open( 3 , "C:\TEMP\LOG.TXT" , 5 ) = 0
$x = WriteLine( 3 , "KiXtart started at " + @TIME + @CRLF )
ELSE
BEEP
? "failed to open file, error code : [" + @ERROR + "]"
ENDIF
Edited by Howard Bullock (2004-01-13 09:39 PM)