Variables and constants declared (using the
Dim
, Static
, or Const
statements) within a CitectVBA procedure
(subroutine or function) have local scope to only that within the
procedure. This means that procedural level variables and constants
cannot be referenced (accessed and used) from anywhere outside of
that procedure.
|
UNINTENDED EQUIPMENT OPERATION Do not use the Global, Public, or Private keywords in your CitectVBA procedures. Using these keywords in procedures can lead to unintended equipment operation when your program is run. Failure to follow these instructions can result in death, serious injury, or equipment damage. |
Procedural level variables declared using the
Dim
statement do not retain their
assigned values when dereferenced. Procedural level variables
declared using the Static
statement,
however, do retain their assigned values between references, even
after that procedure moves out of scope.