Class wwScripting

The 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.

Code execution runs against ASP style script which can evaluate script expressions (<%= %>) and full code blocks (<% %>). The script parser converts templates into pure FoxPro source code that is executed either from a PRG/FXP file on disk using the RenderAspScript method or from memory using the ExecScript method.

The wwScripting class is used as the script parser for Response.ExpandScript and generic script execution in the Web Connection Framework.

Custom
  wwScripting

Class Members

MemberDescription
ExecScript 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)
MergeText Provides Template parsing for expression evaluated tempaltes. Unlike script pages, MergeText evaluates pages by parsing each script block individually and executing the code contained in it. Uses EVALUATE for <%= %> expressions and EXECSCRIPT for <% %> blocks.
o.wwScripting.MergeText(lcText,llIsFile)
RenderAspScript Renders an ASP style page as a compiled VFP program. This method
handles creation of the VFP source code from the script file,
compilation and checking for updates of the file.
o.RenderAspScript(lcTemplate)
cCompiledPath Path where our compiled FXP and WCT files are stored. Defaults to the same path as the template.
cErrorHeader This property can be used to display the top of the error message page should a scripting error occur.
cErrorMsg An error message if the script execution fails. Also set is the lError property.
cScriptCode The input script code saved to a variable.
cScriptResponseClass The Response class used for script processing.
  • wwScriptingResponse
    This is the default Response class used that provides the base functionality. It includes functionality for writing output and clearing output.
cVFPCode The generated VFP code saved for you to review.
lEditErrors If .T. pops up an editor window for editing the error in the code.
lError 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.
lNoVersionCheck 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.
lSaveVfpSourceCode If .t. doesn't delete the generate VFP source code after compiling
lShowFullErrorInfo If .T. displays full error information on the page if possible
lStopOnError Flag used to cause parser to stop on the line of code causing error in VFP
oException 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

Requirements

Assembly: wwscripting.prg

See also:

wwPageResponse::ExpandScript | wwServer::nScriptMode

  Last Updated: 4/30/2008 | © West Wind Technologies, 2008