Name
WriteString -- write string to file
Synopsis
WriteString(id, s$[, len, encoding])
Function
This function writes the string s$ to the file specified by id. The optional argument len can be used to set the number of characters that should be written to the file. If len is omitted, the complete string is written. The file cursor position is advanced by the number of bytes written to the file. Note that this is not necessarily the same as len because in UTF-8 encoding a single character can use up to 4 bytes.

The optional encoding parameter can be used to set the character encoding to use. This defaults to the default string encoding set using SetDefaultEncoding(). See Character encodings for details.

This function is used for writing text to files. If you need to write binary data to a file, use the WriteBytes() function instead. See WriteBytes for details.

Inputs
id
file to write to
s$
string to write to the file
len
optional: number of characters to file or 0 to write the complete string (defaults to 0)
encoding
optional: character encoding to use (defaults to default string encoding) (V7.0)

Show TOC