Subject "Mimmo... Using Ibase functions
Author dogrocket2003
Mimmo, heres the example I was trying to get to allow me to
sequentially access records in a dataset, at this time everything
works except the next function... Is there a better way than my method?

Also does IBASE have a Top function? , is there a manual way to get
back to top of dataset, aside from posting form? This is important if
your scanning a dataset for a match and nothing is found, and you want
to return user to either top or last record (cursor) position.

Whats most secure way to retain current record positon from one page
load to next?

Thanks ahead of time!

// Example of jumping to specific records in a DATASET , sequentialy
like a regular file
// Rev 1.0 dogrocket

// use_unit("");

$conn = ibase_connect("JAYS-PC:C:/DWebsite/files/APPLY.FDB",
"SYSDBA", "masterkey");
$stmt = "Select * From APPLIED";
$iaquery = ibase_query($conn, $stmt);

//Class definition
class QuerySample extends Page
public $displabel = null;
public $Button1 = null;
public $Enterrec = null;
public $datalabel = null;
public $labelinput = null;

function Button1Click($sender, $params)

GLOBAL $conn;
GLOBAL $iaquery;
GLOBAL $row;
GLOBAL $stmt;
GLOBAL $rcursor;

// input is either an N for next record, or a number for record
// (( cant get N or next to work
// i must have to pass varible to session, I thought being global
$rcursor would retain value.?? ))

//enterrec is an edit box for user input.. retrieve user input
if($this->Enterrec->text == 'n')
$rcursor = $rcursor + 1;
// not an N, set record to jump to users input...
$rcursor = $this->Enterrec->text;

// initialize record counter...
$jumpto = 0;

// while current record position is than our input limit.
while($jumpto < $rcursor && $row != EOF)
// retrieve row as an object...
$row = ibase_fetch_object($iaquery);

//adjust cursor to new record location....
$rcursor = $jumpto;

//show our example data field, at desired row.
// using object reference :-)
$this->displabel->caption = $row->JOB_ID;



global $application;

global $QuerySample;

//Creates the form
$QuerySample = new QuerySample($application);

//Read from resource file

//Shows the form