BASIC commands
PROGRAMMING MANUAL
84
Revi
si
on 3.0
3.2.122 FLAG
/i
3.2.123 FLAGS
/i
/i
Type
System command
Syntax
FLAG(flag_number [,value])
Description
The
FLAG
command is used to set and read a bank of 32 flag bits. The
FLAG
command can be used with one or two parameters. With one parameter spec-
ified the status of the given flag bit is returned. With two parameters specified
the given flag is set to the value of the second parameter. The
FLAG
com-
mand is provided to aid compatibility with earlier controllers and is not recom-
mended for new programs.
Arguments
•
flag_number
The flag number is a value from 0..31.
•
value
If specified this is the state to set the given flag to i.e. on or off. This can
also be written as 1 or 0.
Example
FLAG(27,ON)
Set flag bit 27 on.
See also
N/A
Type
System command
Syntax
FLAGS([value])
Description
Read and set the
FLAGS
as a block. The
FLAGS
command is provided to aid
compatibility with earlier controllers and is not recommended for new pro-
grams. The 32 flag bits can be read with
FLAGS
and set with
FLAGS(value)
.
Arguments
•
value
The decimal equivalent of the bit pattern to which the flags must be set.
See the table below.
Example
FLAGS(146) ' 2 + 16 + 128
Set Flags 1,4 and 7 on, all others off.
Example
IF (FLAGS and 8) <>0 then GOSUB somewhere
Test if Flag 3 is set.
See also
N/A
Bit number
Decimal value
0
1
1
2
2
4
3
8
4
16
5
32
6
64
7
128
I52E-EN-03.book Seite 84 Freitag, 29. Juni 2007 11:55 11