DocsBuilt-in functions
Output and mistakes
Print lines, check what kind of value you have, and stop with a message.
$print[values...]
Writes the values in the Output, side by side.
print.naja
$print[Score:;10;points]
$print[Two + two is $sum[2;2]] najova run print.naja
Score: 10 points Two + two is 4
$type
$type[value]
What the value is: nil, bool, number, text, vector, colour, list, table, thing, function or link.
type.naja
$print[$type[5] $type[hi] $type[$list[1;2]] $type[nil]] najova run type.naja
number text list nil
$error
$error[message]
Stops the script with a message in the Output.
error.naja
$function[withdraw;amount]
$if[$get[amount] > 100]
$error[You can take out 100 at most, not $get[amount].]
$endif
$return[$get[amount]]
$endfunction
$print[$withdraw[40]]
$print[$withdraw[500]] najova run error.naja
40
error.naja:3: You can take out 100 at most, not 500.