int FileReadWord(int file)
Pass a handle to a file opened in read mode, and returns the integer value of the first two bytes at the current position, and moves the position onto the following byte. The returned number will always between 0 to 65535. The least significant byte is read in first, so effectively performing:
FileReadByte(file) + (FileReadByte(file) << 8)
int file = FileOpen("readme.txt", FILE_READ); Log(str(FileReadWord(file))); FileClose(file); // This read the first two bytes and logs the value // First line is "Welcome to VERGE 3! " so logs // The number '25943' which is the value of 'W' in ascii // plus the value of 'e' raised by one byte // 87 + (101 << 8)== 87 + 25856 == 25943 // Obviously this is more useful as a big number
There are no talkbacks on this documentation page yet. Post the first?
Doc Nav |
Your docs |