Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
ifthenelse [2019/07/15 10:16]
neils
ifthenelse [2019/07/15 10:17] (current)
neils
Line 27: Line 27:
   
 Please refer to the [[operators|Operators]] page for the list of supported operators. Please refer to the [[operators|Operators]] page for the list of supported operators.
- 
-Since version 1.2, multiple statements can be written in one line using the statement separator character ('':''​). This, in combination with the line concatenation character allows you to write multi-line ''​IF ... THEN''​ blocks: 
- 
- if x = y then ~ 
- print "the numbers are equal" : ~ 
- print "​whatever else here" : ~ 
- eq = 1 ~ 
- else ~ 
- print "the numbers are not equal" : ~ 
- eq = 0 
-  
-The above is technically a single line in **XC=BASIC**. 
- 
-Note that no other characters are allowed after the ''​~'',​ not even a whitespace! 
  
 ====== Performance tip ====== ====== Performance tip ======
  
 An ''​ON ... GOTO''​ or ''​ON ... GOSUB''​ construct is faster than its ''​IF ... THEN GOTO/​GOSUB''​ equivalent. Please refer to the [[ON|ON construct]] for details. An ''​ON ... GOTO''​ or ''​ON ... GOSUB''​ construct is faster than its ''​IF ... THEN GOTO/​GOSUB''​ equivalent. Please refer to the [[ON|ON construct]] for details.