Execute

Executes a statement in a protected environment. Any errors encountered are recoverable.

Syntax:

Execute statement

Parameters:

(s) statement any executable WIL statement.

Returns:

(not applicable)

 

Use this command to execute computed or user-entered statements. Due to the built-in error recovery associated with Execute, it is ideal for interactive execution of user-entered commands.

Note: The Execute command doesn't operate on a string, per se, but rather on a direct statement. If you want to put a code segment into a string variable, you must use the substitution feature of the language, as in the example below.

Example:


cmd = ""
cmd = AskLine("WIL Interactive", "Command:", cmd, 0)
Execute %cmd%
See Also:

IntControl 87, ErrorMode