wwScripting class provides a simple mechanism for executing ASP style
<% %> script pages containing Visual FoxPro code. The class provides a mechanism for dynamically executing script templates including full semantics for compilation and runtime version checking to provide optimal execution performance as pure FoxPro code.
The class also has support for:
- Layout Pages (master page that content pages can load into)
- Partial Pages (child pages that get loaded into a parent page)
Code execution runs against ASP style script which can evaluate script expressions (
< %= and
% >) and full code blocks (
< % and
% >). The script parser converts templates into pure FoxPro
PRG file source code that is executed on disk using the
RenderAspScript() method or from memory using the
ExecScript() method (more limited).
wwScripting class is used as the script parser for Response.ExpandScript and generic script execution in the Web Connection Framework.
Compiles an ASP script template into PRG and FXP files if needed. If the FXP file exists and is newer than the script file, no compilation is performed.
This method is used to execute a script template using the FoxPro ExecScript command. This method can accept input from a file or from a string that holds the ASP style template.
o.ExecScript(lcTemplate as string, llIsCodeString)
|A base property used for partials, and layout pages with ~/ is used in the path. Set this value to the path that identifies ~/.
|Path where our compiled FXP and WCT files are stored. Defaults to the same path as the template.
|This property can be used to display the top of the error message page should a scripting error occur.
|An error message if the script execution fails. Also set is the lError property.
|The input script code saved to a variable.
|The Response class used for script processing.
|The generated VFP code saved for you to review.
|If .T. pops up an editor window for editing the error in the code.
|Error flag that can and should be checked after running a script or template. You can also check the cErrorMsg property for a string error message.
|If .T. doesn't check or attempt to compile the file, but just executes the FXP. Assumes the FXP exists and fails if it does not exist.
|If .t. doesn't delete the generate VFP source code after compiling
|If .T. displays full error information on the page if possible
|Flag used to cause parser to stop on the line of code causing error in VFP
|A VFP 8/9 Exception object which is set when an error occurs. Usually you don't need to look at this as the cErrorMesage
See also:wwPageResponse::ExpandScript | wwServer::nScriptMode | Templates and Scripts - MVC for Web Connection
Comment or report problem with topic