Access ELF Documentation Access ELF Tutorials Access ELF On-Line Help Access ELF Downloadable Help File Access ELF FAQ VB ELF Documentation VB ELF Tutorials VB ELF On-Line Help VB ELF Downloadable Help File VB ELF FAQ
Configuration & Licensing Options
Critical Opinions
Our Users Talk Back






Debug Scripts (Settings/Preferences tab)


Because of the complexity of working with scripts, we've provided an easy way to trace the values of all variables on entry and exit from scripts you attach to ELF processes.

When debugging scripts, you should also realize that normal programming techniques are available. For instance, you can place MsgBox statements within VBScript code, and alert() function calls within JScript code. Since these scripts are not pre-compiled, it's an extremely smooth method of testing your code. Simply type a line of debugging code into the script panel, and press F9 to save the record. Then test the question from the Query window and check the message boxes that appear.

The Debug message boxes appear on entry to each script which is fired and again on exit from that script. It displays the contents of all variables which may be related to the use of the script. If a Debug panel is not appearing for a given script, it means that the conditions required for triggering that script have not been met. For instance, a Phrase script (listed in the Script Name column of Phrases) will only fire when the string appearing in the corresponding Phrase Trigger column is detected in the question. [Be especially careful typing Script Name entries of Phrase scripts, because unlike with other script types, these names are not checked against the script library upon key-in.]

One case which produces results which seem surprising at first is the use of the "Debug Scripts" option with Phrase scripts. Not only do Debug message boxes appear when Phrase scripts are triggered, but in this case entry and exit debug messages are displayed for an Answer script. This is true even if no Answer script is registered on the Preferences tab of the Settings window. The explanation for this is that Phrase scripts may also be used to set the WarningCode and WarningString variables. For instance, you may want the user to be made aware that a particular phrase substitution has been made, or display a Help message or other text when certain words are used in a question. This is done by setting the WarningCode variable to a nonzero value (within the Phrase script) and placing the text message to display in the WarningString variable. If "Show Warnings" is set ON (Advanced tab), this message will be displayed following the execution of any Answer scripts. The AnswerScript can cancel this message by setting the WarningCode value back to zero.

For example, a Phrase script could be used simply to add an warning message to a Phrase macro which could otherwise be handled entirely by the When I Type, I Really Mean method.

When I Type: [toys]    I Really Mean: confections    ScriptName: HardSell

function HardSell

   if PhraseTrigger="toys" then
      WarningCode=1
      WarningString = "Wouldn't you rather see Sweets than Toys?!"
   end if

end function

When writing scripts, be careful to compare strings using the proper case corrections. Script code is sensitive to differences in case, so that "toys"<>"Toys". You may need to use VBScript's UCase() or JScript's toUpperCase() functions for flexibility.

Example: if UCase(PhraseTrigger)="TOYS" then


Last Updated: March, 2002