void FileWrite(int file, string s)
Pass a handle to a file that is opened in write mode, and a string to be written. The string is written from the current position in the file, overwriting any existing data. It uses a 1 byte ascii representation for each character, with no padding or escape sequence - so bytes used is equal to len(s).
int file = FileOpen("datafile.dat", FILE_WRITE);
FileWrite(file, "a");
FileClose(file);
// This creates/overwrites a file one byte in size
// Opened in a hex editor the contents will be: '61'
// Which is the ascii code of a little a
int file = FileOpen("datafile.dat", FILE_WRITE);
FileWrite(file, "Hello Number 1");
FileClose(file);
// Always writes one byte per character
// So this is a 14 byte file. In hex:
// '48 65 6c 6c 6f 20 4e 75 6d 62 65 72 20 31'
There are no talkbacks on this documentation page yet. Post the first?
Doc Nav |
![]() |
Your docs |
![]() |