Incode Systems Home Page Incode Systems, Inc.


(Page) Set Var .SV



Set Variable

Can be used to assign a string or numeric value to a variable.

Only literal values or variable references are allowed; no calculated values. Use .CV to calculate.

Examples:

.SV MYVAR=FOO

After to .SV statement above is executed by PAGE, the variable MYVAR may be referenced anywhere in the text output, or within another .SV or .CV, like this:

Within text:

Here is the text of my document with &MYVAR& inserted where desired, as many times as needed.

In a .SV:

.SV ANOTHERVAR=&MYVAR&BAR

After the .SV immediately above is executed, the variable ANOTHERVAR is equal to FOOBAR.

Within a .CV or .SV, variable names may even be used on the left side of the equal sign to generate composite variable names at run time:

.SV ARRAY&MYVAR&=THIS

After the .SV immediately above is executed, the variable ARRAYFOO is equal to THIS.