UniBasic Commands Reference - Rocket Software

UniBasic Commands Reference - Rocket Software UniBasic Commands Reference - Rocket Software

rocketsoftware.com
from rocketsoftware.com More from this publisher
11.04.2013 Views

Example In the following example, the program segment first uses the ECL T.ATT command to reserve tape unit 0 and specifies no conversion code. Then a routine reads all the records on the tape (until the end of the file or tape) and calls an internal subroutine that processes the record. After the process is finished, the REWIND command rewinds the tape. 1-692 UniBasic Commands Reference PERFORM "T.ATT DO" DONE = 0 LOOP READT UNIT (00) TAX.RECORD ELSE DONE = 1 UNTIL DONE DO GOSUB PROCESS.RECORD REPEAT REWIND UNIT (00) ELSE PRINT 'REWIND UNSUCCESSFUL' Related Commands UniBasic READT, RESIZET, WRITET UniData SETTAPE, T.ATT, T.DET – For information, see the UniData Commands Reference.

RND Syntax RND(num.expr) Description The UniBasic RND function returns a random integer from 0 through num.expr minus 1. Example In the following example, the program statement prints a random number from 0 through 9: PRINT RND(10) Related Command UniBasic RNDSEED RND 1-693

RND<br />

Syntax<br />

RND(num.expr)<br />

Description<br />

The <strong>UniBasic</strong> RND function returns a random integer from 0 through<br />

num.expr minus 1.<br />

Example<br />

In the following example, the program statement prints a random number from 0<br />

through 9:<br />

PRINT RND(10)<br />

Related Command<br />

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

RNDSEED<br />

RND 1-693

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

Saved successfully!

Ooh no, something went wrong!