void FileWriteLn(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, and appends a 2 byte newline sequence on the end of the string - so bytes used is equal to len(s) + 2.
int file = FileOpen("datafile.dat", FILE_WRITE);
FileWriteLn(file, "a");
FileClose(file);
// This creates/overwrites a file three bytes in size
// Opened in a hex editor the contents will be: '61 0d 0a'
// Which is the ascii code of a little a
// With two characters added to denote the new line
int file = FileOpen("datafile.dat", FILE_WRITE);
FileWriteLn(file, "Hello");
FileWriteLn(file, "Peeps");
FileClose(file);
// Opened in a text editor this reads:
// "Hello
// "Peeps
// ""
// Three lines, with the last one blankThere are no talkbacks on this documentation page yet. Post the first?
Doc Nav |
![]() |
Your docs |
![]() |