FileWriteString()

Summary

Writes a character string to a binary file.

Syntax

FileWriteString(file f, string text, integer length)

Argument Contents
f A file handle
text Character string to be written to the file
length Number of bytes to be written to the file

Notes

  • Length-1 characters are always written to the file, followed by a null character.

  • The string is always terminated with a null character.

  • Strings that are shorter than length-1 are padded with null characters.

Error Codes

Error Type Meaning
Error Cannot write to the file (e.g., out of disk space, the file is not open, or the file is open in the wrong mode)

See Also

Function Summary
CloseFile() Closes a file
FileReadString() Reads a character string from a binary file
OpenFile() Opens a text or binary file on disk