Trace.on

From AGI Wiki
Jump to navigationJump to search

The trace.on command turns the debugger trace mode on.

Syntax

trace.on();

Remarks

The trace.on command switches the interpreter cycle to trace mode.

Trace mode must first be enabled (by setting reserved flag f10 (command tracer enabled)). Using trace.on when f10 is FALSE will have no effect.

The trace.info command is normally used prior to entering trace mode to adjust the location of the trace window and identify a logic that contains the text values of each AGI command. It is not required though.

Once enabled, there is no equivalent 'trace.off' command. The only way to exit trace mode is to use the SCROLL LOCK key, which acts as a toggle for trace mode. Keep in mind that this means that if f10 is TRUE, the player can also enter trace mode by pressing the SCROLL LOCK key.

For a detailed discussion of how the trace mode works, see the AGI Command Tracer topic.

Possible Errors

None.

Example

Code:
set(enableTrace); [ enable trace mode
if(said("trace"))
  {
  trace.info(TracerLogic, 1, 10);  [ assume TracerLogic is a valid logic ID
  trace.on();
  }

Technical Information

Required Interpreter Version: Available in all AGI versions.
Byte-Code Value: 149 (0x95 hex)

See Also

Debugging Commands
trace.info
AGI Debugging Information
AGI Command Tracer