FPutc


Function FPUTC ( file index, character )


Returns the number representing the ASCII value of character on success.


Syntax FPUTC ( 1, 10 )


Remarks

file index is a whole number that is a valid, open file from a previous call to FOpen .


FPutc will take a numeric expression character and write it out as an ASCII character to the file that is opened on file index.

Valid values for character are 0 to 255 (the same as the ASCII set).

If character does not fit in this range it will be clamped via modulo and a single byte in the range will be written out.


See Also:

FPuts FGetc FOpen File and Directory functions


Example Script


' Write the ASCII chart out to a file. Skips NULL


NUMBER i


KILL("ASCIIVals.txt")

FOPEN(1,"ASCIIVals.txt")


FOR i = 1 TO 255 ' start at 1 to avoid writing a NULL into the file.

FPUTC(1,i)

NEXT


FCLOSE(1)


Script Output


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