logo
Home XtGem- Templates- XtScript- bottom
Variables can be defined by using assign or var
[...] = optional ... = your value
assign $...=...
var $...=...
assign and var are interchangeable
Standard Xtscript variables are of the form $name
The examples in this manual all use var ... its shorter.
Show in textarea
<!--parser:xtscript-->
# assign a variable
var $a = 120
print \$a=$a<br />

#a variable from a equation
var $b=($a*42)
print \$b=$b<br />

#a string variable
var $c = some words
print \$c=$c<br />

# a variable from a function
var $d=call mt_rand $min=100; $max=200
print \$d=$d<br />

# multi line pre formatted text variable using double curly brackets
var $f={{
multi line
pre formatted text
assigned to a 
variable
}}
print \$f=<pre>$f</pre>
<!--/parser:xtscript-->
Show in textarea
Reload
$a=120
$b=5040
$c=some words
$d=105
$f=
multi line
pre formatted text
assigned to a 
variable
Powered by XtGem
About us Contact Forum topÂ