Relational operators

A number of relational operators can be used to determine a condition for an if statement.

By using these operators you can perform any kind of check you require and then run code based on that result. This simple example demonstrates these operators in practise. Try changing the value of score to see what impact it has.

score as integer = 1

do if score = 100 print ( "the score is equal 100" ) endif
if score <> 100 print ( "the score is different to 100" ) endif
if score > 0 print ( "the score is greater than 0" ) endif
if score >= 0 print ( "the score is greater than or equal to 0" ) endif
if score < 0 print ( "the score is less than 0" ) endif
if score <= 0 print ( "the score is less than or equal 0" ) endif
sync ( ) loop