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.

LT<br />

Syntax<br />

expr1 LT expr2<br />

Synonym<br />

<<br />

Description<br />

The <strong>UniBasic</strong> LT relational operator tests whether expression expr1 is less than<br />

expr2.<br />

expr1 and expr2 can be any valid <strong>UniBasic</strong> expressions, variables, strings, or literals.<br />

Relational operators make the comparisons that direct program flow in conditional<br />

statements such as the following:<br />

IF VAR1 LT VAR2 THEN GOSUB SUB1<br />

DO UNTIL VAR1 < VAR2<br />

Example<br />

In the following example, the program segment tests whether A is less than B.<br />

Because A is less than B, the message “Less than” prints.<br />

A = 21<br />

B = 22<br />

IF A LT B THEN<br />

PRINT "Less than"<br />

END ELSE<br />

PRINT "Greater than"<br />

END<br />

LT 1-433

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

Saved successfully!

Ooh no, something went wrong!