Company Events Academic NI Developer Zone Support Solutions Products & Services Contact NI MyNI

Command: GlobalDim

DIAdem 2011 Help

Edition Date: July 2011

Part Number: 370859J-01

»View Product Info

Declares global variables and reserves memory space for these variables. Global variables are valid and retain their contents as long as DIAdem is running and you do not restart the script engine.

Call GlobalDim(VarName)

Input Parameters

VarName Specifies the name of a global variable.

You can access global variables in all DIAdem panels, in scripts, and in dialog boxes. Use the syntax @@MyVar@@, for example, when you want to display the global variable MyVar in a text.

Note  To delete global variables, you must restart the script engine with the ScriptCmdReset command.
Note  You also can define global variables in user command files. Declare the variable in the global range outside a function and register this user command file.
Note  Use the GlobalRedim command to declare global dynamic arrays.
Note  Use ItemInfoGet to check whether the variable already exists and whether the GlobalDim commands has executed it.

Examples

The following example defines the scalar variable MyVar and the array variable MyArray as global variables. The command GlobalDim is only executed if the variable MyVar does not already exist.

If Not Iteminfoget("MyVar") Then
  Call GlobalDim("MyVar, MyArray()")
End If

Related Topics


 

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
Add Comments 1 2 3 4 5 submit