12.07.2015 Views

GLE User Manual - Fedora Project Packages GIT repositories

GLE User Manual - Fedora Project Packages GIT repositories

GLE User Manual - Fedora Project Packages GIT repositories

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

6.5. IF-THEN-ELSE 51Besides for-next loops, <strong>GLE</strong> also supports while and until loops:i = 0while i 10print "Value: " ii = i + 1next6.5 If-then-else<strong>GLE</strong> supports if-then-else statements as follows:if a < 1 then print a "is smaller than 1"else if a < 2 then print a "is smaller than 2 but larger than 1"else if a < 3 then print a "is smaller than 3 but larger than 2"else print a "is larger than 3"to create blocks of code for the ‘then’ and ‘else’ branches, instead use:if a < 1 thenprint a "is smaller than 1"...else...end ifMore complex conditions can be created with the logic connectives ‘and’, ‘or’, and ‘not’ (note the parenthesisaround the logical expressions):if (a >= 1) and (a

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

Saved successfully!

Ooh no, something went wrong!