Difference between revisions of "File.skip"

From OpenEUO
Jump to: navigation, search
(play mrs.pacman http://aerovida.tripod.com/www.18teenboys.co.html www.18teenboys.co miniclip.com play free games http://aerovida.tripod.com/ sora)
(killspam)
 
Line 1: Line 1:
paBwC7 <a href="http://dhxzrbaveiws.com/">dhxzrbaveiws</a>, [url=http://vuekqtmqnjmg.com/]vuekqtmqnjmg[/url], [link=http://ucvekdpafmts.com/]ucvekdpafmts[/link], http://flckerhisbiv.com/
+
== Calling Pattern ==
 +
Call
 +
  local f = sl.file(a,'read')
 +
later:
 +
local r = f.skip(n)
  
ilovebobbi.com http://eleanordoty37.angelfire.com/st.-gertrude-s-cemetery-colonia..html st. gertrude s cemetery colonia. tennesseeanytime.org foil results.jsp http://eleanordoty37.angelfire.com/email.clearwire.net.html email.clearwire.net
+
Arguments
 +
  n is a number
  
answer strippersgonecrazy.com http://barbarahuey94.tripod.com/recommendations-of-sfas-no.123-r.html recommendations of sfas no.123 r  part ladhs.gov http://barbarahuey94.tripod.com/reply-www.hotblackgirls.com.html reply www.hotblackgirls.com
+
Results
 +
r is of value EOF, nil, or true
  
www.dogging pics http://travislion80.tripod.com/www.dogging-pics.html www.dogging pics  847 www.adultspace.co.nz http://travislion80.tripod.com/adultspacecom.html adultspacecom
+
== Example Usage ==
  
play mrs.pacman http://aerovida.tripod.com/www.18teenboys.co.html www.18teenboys.co miniclip.com play free games http://aerovida.tripod.com/ sora
+
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.
 +
 
 +
== See Also ==
 +
 
 +
* [http://www.easyuo.com/openeuo/wiki/index.php/Simplelib simplelib]
 +
 
 +
* [[EOF]]
 +
 
 +
* [[file.readnext]]
 +
 
 +
* [[nil]]

Latest revision as of 19:32, 15 July 2012

Calling Pattern

Call

local f = sl.file(a,'read')

later:

local r = f.skip(n)

Arguments

n is a number

Results

r is of value EOF, nil, or true

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.

See Also