You must be logged in to do that.

FileWrite

FileWrite
void FileWrite(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, with no padding or escape sequence - so bytes used is equal to len(s).

Example Usage

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'
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.