NVAR

Numeric variable that can store and return the numeric values you specify.

 

Syntax

Description

NVAR n = x

Sets the value of the specified numeric variable.

NVAR n

Returns the value stored in the specified numeric variable.

 

The NVAR command syntax uses these parameters:

Parameter

Description

n

An integer from 1 to 100. This is the unique identifier for the numeric variable.

x

The value stored in the numeric variable. This can be any numeric expression.

 

The default value of a new NVAR is not always 0. For this reason, it is recommended that you initialize each NVAR in your template by setting it to a specific value (such as 0) at the beginning of the template. You can initialize specific NVARs or initialize all NVARs and SVARs.

 

Example:

NVAR 3 = PI

Stores the value of PI in variable 3.

NVAR 3

Returns the value of PI.

 

Example:

NVAR 1 = (1+2)

Stores the value 3 in variable 1.

NVAR 1

Returns 3.

 

Example:

NVAR 22 = [D1]

Stores the numeric value of cell [D1] in variable 22.

NVAR 22 = ( NVAR 22 + 1)

Increments the value of variable 22 by 1. (Adds 1 to the current value of variable 22 and stores this new value in variable 22.)

NVAR 22

Returns the value of variable 22. (Returns the numeric value of [D1] plus 1.)