Print the provided var in a format appropriate for use in a nesla script. This will recursively print entire tables.
printvar(object var)
Parameter Description var Object to be printed. Can be any object type, including table.
Returns zero.
Any argument that is not a string will be formatted automatically. Boolean values will be 'true' or 'false' and numbers will have up to 6 digits past the decimal. Most string functions may be binary safe, but this function _will_ terminate its output at the first \0 character.
The example "var x={}; x.y=x; printvar(x);" is valid code. It also recurses infinitely. Be careful, or you may be cursing infinitely yourself.
The following examples demonstrate the difference between print and printvar.
var x="this \"is a\" test\n";
print(x);
will display
this "is a" test
var x="this \"is a\" test\n";
printvar(x);
will display
"this \"is a\" test\n"
var x={ { key='c' }, { key='a' }, { key='b' } };
printvar(x);
will display
{ [0] = { key = "c" }, [1] = { key = "a" }, [2] = { key = "b" } }