Watch Properties window

BASin

Watch Properties window

The Watch Properties window is available from the Watch List window.

Watch properties window

When you create a new Watch, or edit a Watch you have already created, this window will allow you to customise the way that the Watch behaves.

Note: When creating a new watch, this is known as the Add Watch window.

Firstly, the "Enabled" checkbox will allow you to turn on or off the watch in question. A disabled watch will not be evaluated at runtime, and so can speed up debugging when many watches are created but not necessarily needed at the current time.

After this, you can choose what type of Watch you want from the "Watch Type" drop-down list:

Types of watches available

  • Expression Watches

    An Expression watch will evaluate the expression you specify in the edit field below. This can be any Sinclair BASIC expression, including variables and memory PEEKs. Below this, you can opt to break execution (suspend the program) if the expression evaluates to a non-zero result. This is similar to the conditional breakpoint, but different in one important respect. Watches are evaluated as each line and statement is executed, and so are constantly updated. A conditional breakpoint will only be evaluated when the specified line and statement number has been reached, so an Expression Watch can break whenever the expression results non-zero, which can be handy for tracking down where a particular variable is corrupted, say.

  • Variable Watches

    The Variable watch is similar to the Expression Watch but is restricted to only watching the variables that have been declared at runtime or as a Direct Command. These watches can not break execution. You can choose which variable by either typing in the name, or selecting it from the drop-down list.

  • System Variable Watches

    These are similar to the Variable Watches, in that you can only select to monitor a System Variable (see Chapter 25 of the Sinclair BASIC Manual for more on these) from the drop-down list. These watches cannot break program execution. They will be displayed in their correct format - two-byte words, or single byte values, or lists of multi-byte contents.

  • Memory Address Watches

    These watches will monitor the contents of memory addresses. They can display, from the address which lies in the range 0 to 65535, one byte, a Word (two bytes) or a Dword (four bytes). This will be updated between statements, as the other watches are. Again, these watches cannot break program execution.