Hamster-Scripts: Functions (built-in)


print( <text> [ , <text> ...] )

Displays the given text.

When used in Hamster, the text is shown as an "Info" (black on white) in the Log-window.

Returns: Printed text.

print( "And the answer is: ", $answer )

warning( <text> [ , <text> ...] )

Same as "print", but the text is displayed in a way that makes it look "more important".

When used in Hamster, the text is shown as a "Warning" (black on yellow) in the Log-window, so it's displayed even if informational messages are disabled there. As a rule of thumb: A user should never see such a warning under normal circumstances.

Returns: Printed text.

warning( "Brain malfunction! No ideas left! Example halted!" )

debug( <level>, <text> [ , <text> ...] )

debug( <level> )

If only a <level> is given, the current debug-level is set to the given value (a value of 0 turns off displaying debug-messages).

If additional <text> is given, this <text> is only displayed, if the current debug-level is greater or equal to the given <level>.

Returns: Previous debug level.

debug( 255 )
debug( 1, "Counter: ", $Counter )

[www.elbiah.de Hamster Playground Documentation]