11.04.2013 Views

UniBasic Commands Reference - Rocket Software

UniBasic Commands Reference - Rocket Software

UniBasic Commands Reference - Rocket Software

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.

Examples<br />

In the following example, the program segment retrieves the previously saved list<br />

CS_STAFF and assigns it to active list 2. If the list is not found, the program aborts<br />

and displays an error message.<br />

GETLIST "CS_STAFF" TO 2 ELSE<br />

ABORT "NO CS_STAFF saved list found."<br />

In the next example, the program segment creates a select list and saves it. GETLIST<br />

then retrieves the saved list to active list 0 (the default). The program then uses the<br />

IDs in list 0 to retrieve the first 22 Canadian clients.<br />

EXECUTE 'SELECT CLIENTS WITH COUNTRY = "Canada"'<br />

EXECUTE "SAVE.LIST 'canadians'"<br />

OPEN 'CLIENTS' TO CLIENT.FILE ELSE ABORT<br />

GETLIST 'canadians'<br />

ELSE PRINT "SELECT LIST CANNOT BE FOUND";STOP<br />

PRINT @(-1)<br />

FOR I = 1 TO 22<br />

READNEXT ID ELSE EXIT<br />

READ REC FROM CLIENT.FILE, ID THEN<br />

PRINT @(5,I):REC:@(20,I):REC<br />

END ELSE<br />

PRINT "CANNOT FIND RECORD":ID<br />

END<br />

NEXT I<br />

CLEARSELECT<br />

END<br />

Related <strong>Commands</strong><br />

<strong>UniBasic</strong><br />

DELETELIST, FORMLIST, READLIST, READNEXT, SELECT, SELECT-<br />

INDEX, SELECTINFO, WRITELIST<br />

UniQuery<br />

DELETE.LIST, GET.LIST, SELECT, SSELECT, SAVE.LIST – For information, see<br />

the UniQuery <strong>Commands</strong> <strong>Reference</strong>.<br />

1-297

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

Saved successfully!

Ooh no, something went wrong!