8.18/6/2018

Set (procedure)

This command assigns a new value to a variable. Only user-defined variables can be set. System variables are read-only. Note that you can also use the assignment operator to assign a value to a variable. See = (operator).

Syntax

set( name, value )

Arguments

name

Variable name, prefixed with the ampersand (&) character. The variable name must already exist.

value

New value to store in the variable. This value can be any valid PlanetPress Talk expression, as long as its type is the same as the variable's original type.

Code Sample Example


set( &invoice_number, (&invoice_number + 1) )
set( &is_bottom, (not(&is_top) and not(&is_middle)) )
&tax_rates[2] :=32
put( &tax_rates[2], @(1,3,5) )
set( &months, ['JAN','FEB','MAR','APR','MAY'] )
set( &mustard_color,[0,20,90,16] )
set( &prices, [12.5632,18.9932,23.6651,27.0300] )
put( &imagefiles[0], 'c\\images\\sushi.png' )