︙ | | | ︙ | |
579
580
581
582
583
584
585
586
587
588
589
590
591
592
|
* Mark: There is only one value of this type; it is used to delimit lists
of values on the stack.
* Array: A reference to an array. You cannot allocate arrays at run time;
the available array memory is fixed at compile time, subject to the global
array definitions.
Some things are not their own types, and are other uses of numbers:
* Null: A null class or null object is represented as zero.
* Boolean: When a boolean is required as input to some instruction, zero
is false, and most other values (of any type) are true, except for sounds
|
>
>
>
>
|
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
|
* Mark: There is only one value of this type; it is used to delimit lists
of values on the stack.
* Array: A reference to an array. You cannot allocate arrays at run time;
the available array memory is fixed at compile time, subject to the global
array definitions.
* Link: A link to another point in the code of some class or global. Where
a link is expected, you can also specify a message to mean that message
block for the Self object.
Some things are not their own types, and are other uses of numbers:
* Null: A null class or null object is represented as zero.
* Boolean: When a boolean is required as input to some instruction, zero
is false, and most other values (of any type) are true, except for sounds
|
︙ | | | ︙ | |
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
|
object; objects which no longer exist still compare correctly. Values
of two different types are never equal to each other.
eq2 ( in1 in2 in3 in4 -- bool )
Test if in1 is equal to in3 and in2 is equal to in4. Comparison works
the same way as the "eq" instruction.
Finished ( -- number )
Returns the value of an internal flag which tells it that the beginning
and ending phases should be skipped. This is a 8-bit number; zero means
don't skip them, and any other number means it does. When the game engine
sets this automatically, it normally sets it to 1, but "-1 FlushClass"
during the input phase sets it to 255. When you set this value by
yourself, you can use any 8-bit number.
|
>
>
>
>
>
>
>
>
|
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
|
object; objects which no longer exist still compare correctly. Values
of two different types are never equal to each other.
eq2 ( in1 in2 in3 in4 -- bool )
Test if in1 is equal to in3 and in2 is equal to in4. Comparison works
the same way as the "eq" instruction.
exec ( link -- )
Go to a link; does not continue executing from here afterward. If the
link is zero then it will be the same as ret.
,exec ( link -- )
Go to a link and then continue executing from here afterward. If the
link is zero then this instruction does nothing.
Finished ( -- number )
Returns the value of an internal flag which tells it that the beginning
and ending phases should be skipped. This is a 8-bit number; zero means
don't skip them, and any other number means it does. When the game engine
sets this automatically, it normally sets it to 1, but "-1 FlushClass"
during the input phase sets it to 255. When you set this value by
yourself, you can use any 8-bit number.
|
︙ | | | ︙ | |
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
|
then all bits are shifted out and the result is zero.
,rsh ( in shift -- out )
Arithmetic right shift. If the shift amount is out of the range 0-31,
then all bits are shifted out; the result will be -1 if the input is
negative, or 0 otherwise.
s? ( any -- bool )
True if the value is a string (which may be either a string in the class
codes or a string in the level), or false if it is any other type. Error
if it is a sound.
Seek ( obj -- dir )
Returns the direction from this object to the specified object. If that
|
>
>
>
|
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
|
then all bits are shifted out and the result is zero.
,rsh ( in shift -- out )
Arithmetic right shift. If the shift amount is out of the range 0-31,
then all bits are shifted out; the result will be -1 if the input is
negative, or 0 otherwise.
rtn ( -- )
Same as "ret then".
s? ( any -- bool )
True if the value is a string (which may be either a string in the class
codes or a string in the level), or false if it is any other type. Error
if it is a sound.
Seek ( obj -- dir )
Returns the direction from this object to the specified object. If that
|
︙ | | | ︙ | |
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
|
also continue from after "then". (This is not the same as the fork
function (or any other function) in C.)
if <truepart> [else <falsepart>] then ( bool -- )
Takes a boolean value from the stack. If true, then <truepart> is executed;
otherwise it tries the other parts; "else" means always do this if none of
the previous parts match.
mbegin <body> repeat ( -- any ) ( -- )
The "mbegin" instruction is a shortcut for "begin tmark while", and it has
the same behaviour.
or <body> then ( any -- any )
Takes a value from the stack. If it is true, leaves it there and skips the
|
>
>
>
>
>
|
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
|
also continue from after "then". (This is not the same as the fork
function (or any other function) in C.)
if <truepart> [else <falsepart>] then ( bool -- )
Takes a boolean value from the stack. If true, then <truepart> is executed;
otherwise it tries the other parts; "else" means always do this if none of
the previous parts match.
link <body> [else <body2>] then ( -- link )
Skips the body and makes a link to the beginning of the body. If there is
a else block, then it executes that instead but will be skipped if the
link to the first body is executed.
mbegin <body> repeat ( -- any ) ( -- )
The "mbegin" instruction is a shortcut for "begin tmark while", and it has
the same behaviour.
or <body> then ( any -- any )
Takes a value from the stack. If it is true, leaves it there and skips the
|
︙ | | | ︙ | |