05.01.2013 Views

Downloading - Weber Marking Systems

Downloading - Weber Marking Systems

Downloading - Weber Marking Systems

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

KEY1, KEY2, ..., KEYN are the key column names<br />

VAL1, VAL2, ..., VALN are the key values<br />

Notes:<br />

Appendix C: Automated Print Control<br />

DB-READ-NEXT returns the record pointed to by the 'record pointer'.<br />

When a file is opened, a 'record pointer' for the DB-READ-NEXT<br />

function is set to point to the first record in the file. This 'record<br />

pointer' can be changed in several ways:<br />

1) By calling DB-READ-NEXT without the START-AT clause -<br />

When DB-READ-NEXT is called (without the START-AT clause),<br />

the next record in the file is returned and the 'record pointer' is<br />

incremented to point to the following record in the file.<br />

2) By calling any other database function (DB-READ, DB-UPDATE,<br />

DB-INSERT, DB-DELETE-RECORD, DB-OPEN), which will set the<br />

'record pointer' to the beginning of the file.<br />

3) By calling DB-READ-NEXT with a START-AT clause. This will<br />

create a record set of all records in the file with key value greater than<br />

or equal to the specified key. The 'record pointer' will point to the first<br />

record in that record set. Subsequent DB-READ-NEXT commands<br />

that don't contain a START-AT clause will return records from this<br />

record set.<br />

If end-of-file is reached, or any other error occurs, $ERRORCODE is<br />

set to 1. For example:<br />

DB-OPEN="ADDRESSES", "EMPLOYEES", $HANDLE, QUERY<br />

:LOOP<br />

DB-READ-NEXT=$HANDLE, "LAST NAME", $NAME<br />

IF-EQUAL=$ERRORCODE, 1, EXIT<br />

MESSAGE-BOX="NAME", $NAME<br />

GOTO=LOOP<br />

:EXIT<br />

DB-CLOSE=$HANDLE<br />

This will display one message box containing the last name for every<br />

entry in the table "EMPLOYEES'. Here's another example:<br />

DB-OPEN="ADDRESSES", "EMPLOYEES", $HANDLE, QUERY<br />

DB-READ-NEXT=$HANDLE, "LAST NAME", $NAME, START-<br />

AT, "LAST NAME", "WEBER"<br />

:LOOP<br />

IF-EQUAL=$ERRORCODE, 1, EXIT<br />

MESSAGE-BOX="NAME", $NAME<br />

DB-READ-NEXT=$HANDLE, "LAST NAME", $NAME<br />

GOTO=LOOP<br />

Legitronic User Manual (v3.4) 207

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!