Assign Instruction
Syntax
Group
Description
Assign the value of the rhs to the lhs.
Parameters |
Description |
This string represents the variable expression to be set. |
|
Evaluate this string value and assign it to the lhs expression. |
|
This integer value indicates how deep into the stack to locate the local variables. If Depth = 0 then use the current procedure. If this value is omitted then the depth is 0. |
VBA
This language element is not VBA compatible.
See Also
Example
Sub Main
Dim X As String
Assign "X", """Hello"""
Debug.Print X 'Hello
A
Debug.Print X 'Bye
End Sub
Sub A
Dim X As String
Assign "X", """Welcome"""
Assign "X", """Bye""", 1
Debug.Print Eval("X") 'Welcome
Debug.Print Eval("X",1) 'Bye
End Sub