Quick References
ADO
ASP
CSS2
HTML
JavaScript
Jet SQL
VBScript
WML
WMLScript
WSH
XHTML
XML DOM
XSLT
Features
Knowledge Base
Tutorials
Partners
ZVON.ORG
XML
Planet Source Code
VisualBuilder
Web Design
Your HTML Source
XML/XSLT Forums
ASPAlliance
Scripts
Programmers Heaven
Tek-Tips Forums
Developer Fusion
Code Project
A100207: How to Evaluate a VBScript Expression at Run Time.
The
Eval
function and the
Execute
statement which are new features in VBScript 5.0 are closely related. They both can be used to evaluate, or execute, a VBScript expression at run time.
Eval
takes any valid VBScript expression as its argument. It is designed to be used in the form:
result = Eval(strValidVBScriptExpression)
If the argument is a valid VBscript expression, then
Eval
evaluates the code and sets result equal to the return value.
The
Execute
statement essentially behaves in the same way as
Eval
, but there are two crucial differences. First,
Execute
is used to execute expressions that DO NOT return a value. It is of the form:
Execute("strFact = ""DevGuru is great!""")
Second, if the argrument is of the form, a = b, then it is treated as an assignment operation where a is set equal to b. In contrast,
Eval
treats the form, a = b, as an equality comparison. It returns true if the comparison is true. Otherwise, it returns false.
Go to Resources Page to download VBScript
The Guru
Copyright 1999-2005 by Infinite Software Solutions, Inc. All rights reserved.
Trademark Information
knoxville photographer
knoxville wedding photographer