Lasso Soft Inc. > Home

[ file->marker ]

Method

The [file->marker] method returns the location of the current marker within the file. The marker determines where in the file data will be written or read and can be set using [file->setMarker].

  • Syntax
local(f) = file(...)
#f->marker
Examples
  • Beginner

Read some bytes from a file

The code below reads a byte at a time from a file until the marker reaches 15 and then stops.

Code

local(my_file) = file('/rhino/test.txt')
handle => { #my_file->close }
#my_file->openRead
while(true) => {^
    if(#my_file->marker > 14) => {^
        loop_abort
    ^}
    #my_file->readSomeBytes(1)
^}

Result

"Great Scott!"

Recent Comments

No Comments found

Please note that periodically LassoSoft will go through the notes and may incorporate information from them into the documentation. Any submission here gives LassoSoft a non-exclusive license and will be made available in various formats to the Lasso community.

LassoSoft Inc. > Home

 

 

©LassoSoft Inc 2015 | Web Development by Treefrog Inc | PrivacyLegal terms and Shipping | Contact LassoSoft