-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathIF.txt
30 lines (24 loc) · 1.05 KB
/
IF.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
IF~THEN(~ELSE)
IchigoJam BASIC
IchigoJam BASIC RPi
IchigoJam PC
-----------------------------------------------------------
[Function]
Perform conditional branching.
[Command format]
IF <condition value> [THEN] <command>
IF <condition value> [THEN] <command> [ELSE <command>] (0.9.4 ~)
[Example]
IF A=B THEN LED 1
IF A=B LED 1
[Commentary]
Execute <command> when <condition value> is correct (when it is not 0).
<condition value> corresponds to multiple conditions by AND and OR from 0.9.4.
Up to 0.9.3 substitute with * and + or & and |. (Condition values before and after are delimited by () pair)
Multiple executions of <command> are possible, separated by ":".
It will cause the command within that line to continue.
Although THEN can be omitted, the line number becomes an error immediately after THEN.
To skip, please use GOTO line number or THEN GOTO line number.
When <condition value> is wrong (in case of 0)
You can execute the command immediately after ELSE. It is optional.
ELSE is supported from 0.9.4.