RawFile.getPosition

From Spheriki

Jump to: navigation, search

Get the position of the file that will be read from.


Contents

Usage

number rawfile.getPosition();
  • 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.


See also

Personal tools