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.

GT<br />

Syntax<br />

expr1 GT expr2<br />

Synonym<br />

><br />

Description<br />

The <strong>UniBasic</strong> relational operator GT tests whether expression expr1 is greater 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 GT VAR2 THEN GOSUB SUB1<br />

DO UNTIL VAR1 > VAR2<br />

Example<br />

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

Because A is greater than B, the message “Greater Than” prints.<br />

A = 24<br />

B = 22<br />

IF A GT B THEN<br />

PRINT "Greater Than"<br />

END ELSE<br />

PRINT "Less Than"<br />

END<br />

1-325

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

Saved successfully!

Ooh no, something went wrong!