DIAdem Help

Method: Eval for VBS

  • Updated2024-09-12
  • 1 minute(s) read

Method: Eval for VBS

Evaluates an expression. If you use an expression like "x = y" , the Eval method checks if both values are equal. If, instead, you want to assign the y value to the x variable, you use the Excecute method.

vEval = Object.Eval(string)
ObjectVBS
Object with this method. You do not need to specify this object.
stringVariant
Specifies which expression to evaluate.
vEvalVariant
Receives the result of the expression.

The following example evaluates various expressions:

Dim MyVar1, MyVar2
MyVar1 = 1
MyVar2 = 2
Call MsgBox(Eval("MyVar1 = MyVar2 + 1")) ' Returns False
Call MsgBox(MyVar1)                      ' Returns 1
Call MsgBox(Eval("MyVar1 = MyVar2 - 1")) ' Returns True

Related Topics

Eval | Execute | RegExp

Log in to get a better experience