Output Variables
Example
call x = "ChardScript is awesome"
echo(x)Example
call x = "ChardScript "
call y = "is "
call z = "awesome"
echo(x + y + z)Example
call x = 5
call y = 10
echo(x + y)Example
Last updated
The ChardScript echo() function is often used to output variables.
call x = "ChardScript is awesome"
echo(x)You can also use the + operator to output multiple variables:
call x = "ChardScript "
call y = "is "
call z = "awesome"
echo(x + y + z)Notice the space character after "ChardScript " and "is ", without them the result would be "ChardScriptisawesome".
For numbers, the + character works as a mathematical operator:
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:
Last updated
call x = 5
call y = "John"
echo(x + y)