11.04.2013 Views

UniBasic Commands Reference - Rocket Software

UniBasic Commands Reference - Rocket Software

UniBasic Commands Reference - Rocket Software

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Parameters<br />

The following table describes each parameter of the syntax.<br />

Parameter Description<br />

Example<br />

In the following example, the program segment selects the IDs in the INVENTORY<br />

file to select list 0, and then builds a dynamic array of the items for which quantity in<br />

stock is greater than 10. The last program statement prints the select list to show its<br />

contents.<br />

1-626 <strong>UniBasic</strong> <strong>Commands</strong> <strong>Reference</strong><br />

dyn.array.var Specifies a dynamic array to contain the values removed from<br />

the select list.<br />

FROM list.num Specifies which select list (0-9) you want to use. If you do not<br />

specify a list.num, UniData reads the default list (0). If no items<br />

are available in the list, UniData executes the ELSE clause.<br />

THEN statements END THEN executes if the read is successful. END is required to<br />

terminate multiline THEN statements.<br />

ELSE statements END ELSE executes if the read is not successful or the list does not<br />

exist. END is required to terminate multiline ELSE statements.<br />

READLIST Parameters<br />

OPEN 'INVENTORY' TO INV.FILE ELSE STOP<br />

SELECT INV.FILE<br />

DONE = 0<br />

LOOP<br />

READNEXT INV.ID ELSE DONE = 1<br />

WHILE NOT(DONE) DO<br />

READ INV.REC FROM INV.FILE,INV.ID ELSE<br />

PRINT "No INVENTORY RECORD: ":INV.ID<br />

END<br />

IF INV.REC > 9 THEN<br />

READLIST LIST.ITEM ELSE LIST.ITEM = " "<br />

END<br />

REPEAT<br />

PRINT LIST.ITEM

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

Saved successfully!

Ooh no, something went wrong!