dbg_watch

This function creates a watch for a variable within the current debug section.

This is simply used to monitor a variable's value, and cannot be used to change it. Look at the Debug View Function Reference for controls that allow variable modification.

Each value is converted to a String and displayed.

NOTE This debug control spans two columns.

 

Syntax:

dbg_watch(ref[, label]);

ArgumentTypeDescription
refReferenceA reference to a variable created with ref_create
labelStringOPTIONAL The label to show

 

Returns:

N/A

 

Example:

Create Event

counter = 0;

dbg_watch(ref_create(self, "counter"), "Counter");

Step Event

counter += 1;

The above code first initialises a variable counter in the Create event. It then adds a watch for this variable using dbg_watch.

In the Step event, the counter is incremented, a change that will be shown by the watch.