Defining Logic > Statements > MapArr

MapArr

Note: the MAPARR statement is available only in the Professional edition of Process Simulator.

The MAPARR statement maps each individual cell of an array to a unique variable. It starts with the variable you specify, (i.e., if you define 12 cells for the array, the array will map to 12 distinct variables). To display the cell value of a mapped array, create a variable graphic for the variable to which you mapped the array cell. Process Simulator can collect statistics for an array cell through the variable to which you mapped that cell. Only changes to the array are recorded; therefore, the initial value of the array cells are not written to the variables. The statement should be used in Initialization Logic.

 

If you do not specify the optional variable name in the statement, Process Simulator will unmap the array from the variables to which you originally mapped it. You can remap arrays by using the MAPARR statement.

Note: Changing the value in a cell of a mapped array WILL also change the value of the variable to which you mapped that specific cell. Changing the value of a variable, however, WILL NOT change the value of the cell of the mapped array.

The following are examples of the MAPARR statement:

MAPARR <array name> TO <variable name>

MAPARR Array1 TO Var10

Components

<array name> — the array that will be mapped. The square brackets, [ ], are unnecessary after the array name in the MAPARR statement.

 

TO <variable name> — the name of the variable to which you want to map the first cell in the array.

 


© 2014 ProModel Corporation • 556 East Technology Avenue • Orem, UT 84097 • Support: 888-776-6633 • www.promodel.com