New control flow constructs:
The "by x" clause is optional and defaults to "by 1".
All loops (while, foreach, for, repeat) allow "break" and "continue" within the loop body.
Functions can now recursively call themselves.
You can now declare a "forward reference" for a function, which allows mutual recursion. Like this:
int my_function( int parm1, boolean parm2);
and then later, you declare the actual function with the same return type and parameters and an actual function body.
New functions:
boolean string_to_boolean( string );
int string_to_int( string );
float string_to_float( string );
item string_to_item( string );
zodiac string_to_zodiac( string );
location string_to_location( string );
class string_to_class( string );
stat string_to_stat( string );
skill string_to_skill( string );
effect string_to_effect( string );
familiar string_to_familiar( string );
slot string_to_slot( string );
monster string_to_monster( string );
The above are the inverse of the previously existing xxx_to_string functions. You can now, therefore, use any simple data type you wish with get_property/set_property
int count( <aggregate> thing );
Returns the number of elements in the specified map or slice.
location my_location();
boolean take_stash( int count, item thing );
Code:
foreach <key> in <aggregate>
<block or statement>
Code:
for <var> from <int expression> upto <int expression> [ by <int expression> ]
<block or statement>
for <var> from <int expression> downto <int expression> [ by <int expression> ]
<block or statement>
The "by x" clause is optional and defaults to "by 1".
Code:
repeat
<block or statement>
until ( <boolean expression> );
All loops (while, foreach, for, repeat) allow "break" and "continue" within the loop body.
Functions can now recursively call themselves.
You can now declare a "forward reference" for a function, which allows mutual recursion. Like this:
int my_function( int parm1, boolean parm2);
and then later, you declare the actual function with the same return type and parameters and an actual function body.
New functions:
boolean string_to_boolean( string );
int string_to_int( string );
float string_to_float( string );
item string_to_item( string );
zodiac string_to_zodiac( string );
location string_to_location( string );
class string_to_class( string );
stat string_to_stat( string );
skill string_to_skill( string );
effect string_to_effect( string );
familiar string_to_familiar( string );
slot string_to_slot( string );
monster string_to_monster( string );
The above are the inverse of the previously existing xxx_to_string functions. You can now, therefore, use any simple data type you wish with get_property/set_property
int count( <aggregate> thing );
Returns the number of elements in the specified map or slice.
location my_location();
boolean take_stash( int count, item thing );