webCOMAND

cTemplate Variable Directives

cTemplate provides several directives to set, access and update variables, including numbers, text and dates and times.

Example

#* set and manipulate numbers: 1 + 2 = 3 *#
#ASSIGN($A, 1)
#ASSIGN($B, 2)
#ASSIGN($C, $A + $B)
$A + $B = $C

#* set and manipulate text: Hello, World! *#
#ASSIGN($A,'Hello' + ', ')
#NEW($B)World#ENDNEW
#APPEND($B)!#ENDAPPEND
$A$B

#* set and manipulate dates: Dec 20, 1975 *#
#ASSIGN($A, '1975-12-08')
#ADJUSTDATE($A, DAY, 12)
#FORMAT($A, '%b %e, %Y')

#* get a variable by reference: Hi *#
#ASSIGN($A, 'Hi')
#ASSIGN($B, 'A')
#REF($B)

#* working with arrays: 3 *#
#ASSIGN($A, ['three', 2])
#ASSIGN($A[2], 1)
#COUNT($A)