WRITELINE

Action

Appends a line to the end of a file. If WriteLine encounters an error, @ERROR is set to the relevant errorcode.

 

 

Syntax

WRITELINE (file handle, "linetowrite")

 

Parameter

File handle

A numeric expression indicating the file handle of the file to append to. 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>, so if you want to write a <Carriage Return>, you should add it to the string (as in : $LineToWrite + @CRLF).

 

Returns

-4

File not open for writing

-3

File handle not open

-2

Invalid file handle specified

-1

End of file

0

Line written successfully

 

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