void FileWriteQuad(int file, int quad)
Pass a handle to a file that is opened in write mode, and an integer to be written. Four bytes will be written at the current position within the file, over any data that was previously there, and position will move to the next byte. As this writes the full value of the verge integer, it will read back exactly as it was stored.
Note that the bytes are stored in order of least significant to most significant. In effect what happens is:
FileWriteByte(quad & 255); FileWriteByte(quad & (255 << 8)); FileWriteByte(quad & (255 << 16)); FileWriteByte(quad & (255 << 24));
int file = FileOpen("datafile.txt", FILE_WRITE); FileWriteQuad(file, 97); // or $61 or 'a' FileClose(file); // Opens/Creats a file and writes four byte to it // Opened in a hex editor gives '61 00 00 00' int file = FileOpen("datafile.txt", FILE_WRITE); FileWriteQuad(file, -2); FileClose(file); // All integers are stored in full // -2 in binary: 11111111111111111111111111111110 // File opened in a hex editor gives 'fe ff ff ff'
There are no talkbacks on this documentation page yet. Post the first?
Doc Nav |
![]() |
Your docs |
![]() |