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

KiXtart Command Reference

WRITELINE

action

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

syntax

WRITELINE (file number, “linetowrite”)

parameter

File number

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

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

example

IF Open( 3 , “C:\TEMP\LOG.TXT” , 5 )  = 0

$x = WriteLine( 3 , “KiXtart started at ” +  @TIME + Chr(13) + Chr(10) )

ELSE

BEEP

? "failed to open file, error code : [" + @ERROR + "]"

ENDIF