Evaluate an expression.

      Eval (StringExpr)

   StringExpr  Any expression that returns a string or a number.

The argument stringexpr must be an expression that is stored in a string. If you pass to the Eval function a string that doesn't contain a numeric expression or a function name but only a simple text string, a run-time error occurs. For example, Eval("Smith") results in an error.


Eval("1 + 1") returns 2.
returns False (-1)
Eval("5 * 10") returns 50

strResult = Eval("MY_Function()")
MsgBox strResult
'displays the result of the function

“More people are killed every year by pigs than by sharks, which shows you how good we are at evaluating risk” ~ Bruce Schneier

Related VBScript commands

Syntax - IsBlank function to detect Empty or NULL or Zero.

Copyright © 1999-2023 SS64.com
Some rights reserved