09.04.2018 Views

Variables Guide

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

ARENA VARIABLES USER’S GUIDE<br />

Functions variables<br />

NSYM ( Symbol Name )—Symbol number. All defined simulation elements have a<br />

unique number. For those constructs that have names, the function NSYM may be<br />

used to return the number corresponding to the construct name. The Symbol Name<br />

must be specified as a simple name or indexed name; the index, if used, may be an<br />

expression. NSYM returns an integer value; it is not user-assignable.<br />

NUMBLK [ ( Block Label ) ]—Block number. NUMBLK returns the number of the<br />

block corresponding to Block Label. It is an integer value; it is not user-assignable. If<br />

Block Label is omitted, NUMBLK returns the number of the current block.<br />

TF ( Table ID, X Value )—Table function value. TF evaluates the value stored in Table<br />

ID for a real-valued quantity X value. TF returns a real-valued quantity; it is not userassignable.<br />

UF ( User Function Number )—User-coded function. UF executes the C, FORTRAN,<br />

or VBA code of function UF, passing User Function Number as the function number<br />

parameter. The return value of UF is provided by the user-coded routine; it is a realvalued<br />

quantity.<br />

General-purpose global variables<br />

Three mechanisms are provided to access the value of a variable. All return real- or<br />

string-valued quantities; variables are user-assignable. Where a Variable Number is<br />

required, it is the construct number of the variable (as listed in the <strong>Variables</strong> module<br />

from the Elements panel). The number may be entered as a constant, an expression,<br />

or as NSYM(Variable Name).<br />

V ( Variable Number )—Variable value. The V( ) array returns the current value of the<br />

specified Variable Number, which is the instance number of the corresponding<br />

variable in the <strong>Variables</strong> module.<br />

VAR ( Variable Number [, Index 1, Index 2 ] )—Variable value. VAR returns the value<br />

of the general-purpose variable Variable Number with associated indices Index 1 and<br />

Index 2; the number of indices specified must match the number defined for the<br />

variable. This variable is used when the actual Variable ID to be accessed or changed<br />

is stored in an attribute, another variable, a static, and so on.<br />

Note: The value of VAR(Variable Name) is not the same as the value of simply the<br />

Variable Name. Using the Variable Name returns the actual variable value; function<br />

NSYM may be used to translate a variable identifier into the desired Variable Number.<br />

32

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!