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.

Note: STACKCOMMON is always on in BASICTYPEs P and M. STACKCOMMON<br />

is off by default in BASICTYPEs R and U.<br />

Examples<br />

In the following example, the program statement performs the command in cmd3 and<br />

sends output to a dynamic array cpt_var:<br />

PERFORM cmd3 CAPTURING cpt_var<br />

In the next example, the program segment executes a variable containing a UniData<br />

command:<br />

LIST.PER = "LIST PERSONNEL WAGETYPE AGE"<br />

PERFORM LIST.PER<br />

In the next example, the EXECUTE statement creates a record ID list using the<br />

SELECT statement. The select list is then used to read records from the file.<br />

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

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

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

GETLIST 'canadians' SETTING LIST.CNT<br />

ELSE PRINT CLIENT:" SAVEDLISTS ID ‘canadians’ CANNOT BE<br />

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 />

In the next example, the program segment executes a paragraph from within a<br />

<strong>UniBasic</strong> program using the EXECUTE statement:<br />

PARA = "PA":@AM:"DISPLAY HELLO"<br />

EXECUTE PARA<br />

This paragraph displays the word HELLO on the terminal screen.<br />

EXECUTE 1-269

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

Saved successfully!

Ooh no, something went wrong!