Description:
Calculate expression and returns value.
In the PROMOTIC system it is better to use the PmExpr object.
Syntax:
Variant Eval(String expression)
Parameters:
expression | (String) String containing any expression in the VBScript language syntax. |
---|
Return value:
The value of calculated expression.
Example:
VBScriptSelect and copy to clipboard
Dim RndNum, Guess
RndNum = Int(100 * Rnd(1) + 1)
Guess = CInt(InputBox("Enter your guess:", "", 0))
If Eval("Guess = RndNum") Then
MsgBox "Congratulations! You guessed it!"
Else
Guess = CInt(InputBox("Sorry! Try again.", "", 0))
End If