You must be logged in to do that.

FileWriteLn

FileWriteLn
void FileWriteLn(int file, string s)

Documentation

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.

Example Usage

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 blank
Talkback

There are no talkbacks on this documentation page yet. Post the first?

Post a new comment?

Ben McGraw's lovingly crafted this website from scratch for years.
It's a lot prettier this go around because of Jon Wofford.
Verge-rpg.com is a member of the lunarnet irc network, and would like to take this opportunity to remind you that regardless how babies taste, it is wrong to eat them.