Name
Execute Statement
Syntax
Execute statement-
statement Use: Required
Data Subtype: String expression
A string expression containing one or more statements for execution.
Description
Executes one or more statements.
Rules at a Glance
statementis a string literal containing one or more statements to execute, or a string variable containing one or more executable statements. An executable statement is any call to a user-defined procedure or function, or any intrinsic VBScript command.You can put multiple statements in the expression; separate them with colons.
You can also separate the arguments with embedded line breaks. We prefer the colons, as it makes the code easier to read.
If
statementincludes an equal sign, it is interpreted as an assignment rather than an evaluation. For example, x = 3 assigns the value 3 to the variable x, rather than comparing the value of the variable x with 3.Code executed by the
Executestatement inherits the scope of the routine from which it’s called; all variables visible to the calling routine are visible to it. The sole exception is code that creates a new procedure (as in the example). This new procedure does not inherit the scope of the calling routine; instead, only global variables and objects are visible to it. However, the procedure itself is not globally available throughout the script; it can be called only from the procedure in which it theExecutestatement was executed.
Example
The following is a corrected version of an example appearing in ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access