Click here to return to the KiXtart HelpDesk main page...

KiXtart 2001 Manual

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 (file number, “linetowrite”)
Parameters: File number

A numeric expression indicating the file number of the file to open. Possible values range from 1 to 10.


The string you want to write to the file.

Remarks: WriteLine does not automatically append a <Carriage Return>, so if you want to write a <Carriage Return>, you should add it to the string (as in : $LineToWrite + Chr(13) + Chr(10)).
-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( ), Open( ), ReadLine( )

IF Open( 3 , "C:\TEMP\LOG.TXT" , 5 ) = 0
  $x = WriteLine( 3 , "KiXtart started at " + @TIME + @CRLF )
  ? "failed to open file, error code : [" + @ERROR + "]"