Personal Notes File


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

  1. Ensure that the currently edited card contains valid PScript code.
  2. From the PScript menu, choose Test.
  3. 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, and SText variables passed to it by NOTEFILE as appropriate.
  4. 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.