RawFile.getPosition
From Spheriki
Get the position of the file that will be read from.
Contents |
Usage
- rawfile Sphere RawFile object. The RawFile to get the position of.
- number is returned, which is the position of the file cursor inside the RawFile.
Examples
This code sample will work as long as the file other/blah.txt contains at least 10 characters:
var rf = OpenRawFile("blah.txt"); rf.setPosition(9); var pos = rf.getPosition(); GetSystemFont().drawText(0, 0, "Position in file is " + pos); FlipScreen(); GetKey();
Notes
- RawFile objects have a cursor, which indicates the position in the file from which data is read or is written to. This function can obtain that position.
- To set the position of the file cursor, use RawFile.setPosition().
See also
- Sphere RawFile object
- FlipScreen()
- Font.drawText()
- GetKey()
- GetSystemFont()