GSAK (Geocaching Swiss Army Knife)
 

Contents - Index


SqlGetClose (command)

SqlGetClose

Iterating throuh a table via SqlGet=Yes, places a "lock" on the table which must be released. When you reach the end of of the table ($_SqlEol = true) this lock is automatically released. However there may be times when you don't want to iterate throught the whole table and you use the Break command to exit the loop. If you do exit the loop before $_SqlEol = true, then you must use SqlClose to make sure you close the table and release the lock.

Example:
 

# list the names of the first 3 caches in the grid
$Data = ""
$x = 0
$status = sqlite("sql",$_SqlGrid, "sqlget=yes")
while not($_sqleol)
  $x = $x + 1
  $data = $data + sqlget("name") + $_CrLf
  if $x = 3
    SqlGetClose
    Break
  EndIf
  sqlnext
Endwhile
cancel msg=$data


See also Sqlite(), SqlGet(), SqlNext

Alpha List         Category List
Copyright 2004-2011 CWE Computer Services  
Privacy Policy Contact