Executing objects safely by wrapping an error handler around any foreign execution.
This class can be used to execute code that is of unknown or variable such as code stored in memo fields and run later, or code stored in script pages and evaluated on the fly. These types of environments require a safety wrapper to make sure that any of this 'external' code doesn't crash the core application.
The wwEval class implements methods that allow you to:
- Evaluate a FoxPro expression
- Execute a single FoxPro command
- Run a CodeBlock in fully interpreted mode at runtime (using CodeBlock)
- Merge a document containing expressions and code blocks (scripting)
All of these operations are implemented as methods of the wwEval class. The class contains an error method which traps these errors and records the error information. Upon return from the execution the calling code can check for errors by checking the lError flag and the cErrorMessage property.
A simple way to fire a timer and execute an expression or code block. Set a delay and specify how often to repeat the timer execution.
You can optionally pass in 3 state values that become available as
Evaluates an expression. This method simply does an EVALUATE() with some provisions for error handling.
Executes a method inside of a class.
o.EvaluateClassMethod(lcClass, lcMethod, lcClassLib)
|Executes a block of code using ExecScript() providing exception handling and error information.
|Excecutes a single FoxPro command safely.
o.MergeText(tcString,tcDelimiter, tcDelimiter2, llNoASPSyntax)
|Error Message if an error occurred.
|On return from an execution method this property contains the type of the result value.
|Error flag set when an error occurs. cErrorMessage and nErrorNo contain further info on the error.
|The error number if an error occurred. Only valid if lError is .T.
|The line the error occurred on.
|Contains the result value of the last executed command if the call succeeded. Typically you don't need to check this value since it will be returned as part of the method call so you can use it directly.
|You can pre-set the error result value. When an error occurs the result value from the code/expression will return this value when an error occurs.
Comment or report problem with topic