File.skip
From OpenEUO
Revision as of 20:16, 27 September 2011 by 59.106.183.209 (Talk) (paBwC7 <a href="http://dhxzrbaveiws.com/">dhxzrbaveiws</a>, [url=http://vuekqtmqnjmg.com/]vuekqtmqnjmg[/url], [link=http://ucvekdpafmts.com/]ucvekdpafmts[/link], http://flckerhisbiv.com/)
paBwC7 <a href="http://dhxzrbaveiws.com/">dhxzrbaveiws</a>, [url=http://vuekqtmqnjmg.com/]vuekqtmqnjmg[/url], [link=http://ucvekdpafmts.com/]ucvekdpafmts[/link], http://flckerhisbiv.com/
Example Usage
h = sl.file(getinstalldir()..'scripts/testread.dat', 'read')
local j = h.skip(4) -- skip first four stored values
print(tostring(j))
local val = true
while val ~= nil and val ~= 'EOF' do
val = h.readnext()
if val == sl.null then val = 'null' end
if val == sl.EOF then val = 'EOF' end
print('val : '..tostring(val))
end
--> true
val : 30
val : TEST_
val : true
val : false
val : null
val : true
val : 3.141622e-030
val : table: 0x011da540
val : EOF
Description
Skip jumps over the number of stored values specified by argument n. A positive n seeks from the current read location towards the end of the file, and negative n seeks towards the beginning of the file. If either the beginning or the end of the file is reached, EOF is returned.
Upon Error
Skip returns nil if there is a problem seeking over the file.