Adding Local Variables to the Method or Process
- Open the signature editor for the method or process.
- Go to the Locals tab of the Signature Editor.
Do one of the following:
- Click the
Add local variable button. - In the Local Variable menu, select Add.
A new local variable is added to the Locals list.
- Click the
- Enter a name for the local variable.
Specify the type for the local variable.
If you selected an array or matrix of enumeration or record type,
the following happens.To edit the size of an array or matrix selected as local variable,
do the following.Enter a comment and a unit for the variable.
If you selected an array, matrix or record as type, additional steps may be necessary:
Activate (deactivate) the Reference option to mark the local variable as explicit reference (instance).
Note
You can export models that use non-scalar method-/process-local variables marked as instances only in AMD format V6.4.0 or higher. An AMD format V6.3.* or older will result in an export error.
- Use the Read for Referenced Element and Write for Referenced Element options to set internal access to the referenced element to Read, Write, or both.
Note |
|---|
Non-scalar local variables specified as instances must be initialized before they are read. For method-/process-local records marked as instances, the separate assignment to each record element is recognized as initialization. The expression must only contain accesses to record elements that are already initialized. Assigning each element of an array or matrix is recognized as initialization. Passing a local variable of array, matrix or record type as Out argument is recognized as initialization. |
See also
Editing the Signature of a Method or Process
Variant Size for Arrays and Matrices
Variable Size for Arrays and Matrices
Constants and System Constants