Output Variables
The ChardScript echo()
function is often used to output variables.
Example
call x = "ChardScript is awesome"
echo(x)
You can also use the +
operator to output multiple variables:
Example
call x = "ChardScript "
call y = "is "
call z = "awesome"
echo(x + y + z)
For numbers, the +
character works as a mathematical operator:
Example
call x = 5
call y = 10
echo(x + y)
In the echo()
function, when you try to combine a string and a number with the +
operator, ChardScript will give you an error:
Example
call x = 5
call y = "John"
echo(x + y)
Last updated