Test PScript Command
Purpose
The Test PScript command is used to run the Pascal script code in the currently edited card as if it were run from a menu item listed at the bottom of the PScript menu.
To test the script in the currently edited card
- Ensure that the currently edited card contains valid PScript code.
- From the PScript menu, choose Test.
- If there are no syntax errors in the contents of the notes information
area (excluding the index line), the Pascal script
will run, updating the
CText,MText, andSTextvariables passed to it by NOTEFILE as appropriate. - The Before (prior to execution of the script) and After (after the script has finished) values of these three variables will be displayed in a dialog box. However, nothing else will be modified; even the old contents of these variables in NOTEFILE will not be changed.
Note: This command will be run while the card containing
the script itself is open; so, for example, the contents of MText
will be the current script. However, any changes to these variables
will not be reflected back to the card. For example,
if MText is modified
by the script, its new contents will not replace the contents of
the card (i.e., the script itself).
Keyboard shortcut
F2
Error messages
If there is a compile-time error in the script, an appropriate error message will be displayed and the insertion point will be positioned close to the error. The two numbers in the error message indicate the line and column position of the error.
Similarly, if there is a run-time error like Divide by Zero, Out Of Range, etc., an appropriate error message will be displayed, but there will be no indication of where this error occurred.