FPuts


Function FPuts( file index, String )


Returns a non-negative value on successfully writing string to the file opened on file index.


Syntax FPuts( 1, "This is a test line" + Chr(10) )


Remarks

file index is the index to a file previously opened by a successful call to FOpen .

FPUTS will write the contents of string to the file open on file index. FPuts does not append a newline character (ASCII value 10).

FPUTS updates the file position (See FTell) to the byte immediately following the end of the string just written.


See Also:

FPutc FGets File and Directory functions


Example Script


' Create a text file and write some stuff to it.


NUMBER i

IF FOPEN(1,"integers.txt") THEN

FOR i = 1 TO 200

FPUTS(1,STR(i) + CHR(10))

NEXT

ENDIF


Script Output


A text file by the name integers.txt will be created in the current working directory. Open the file to view the results.