Hosting and domain costs until October 2024 have been generously sponsored by dumptruck_ds. Thank you!

Difference between revisions of "traceon"

From Quake Wiki

m (Move page script moved page Traceon to traceon: Fixing the case)
 
Line 1: Line 1:
=== Function: traceon ===
+
''void'' '''traceon'''()
  void traceon()
 
  
Start tracing functions, end them with [[traceoff]]()
+
== Usage ==
 +
Starts printing the statements the VM is executing to the console. Useful for debugging code to see what exact steps it's taking. Paired with <code>traceoff()</code> to disable statement printing.
 +
 
 +
== Example ==
 +
// Verify which path the code is executing at a branch
 +
traceon();
 +
if (self.count == 3)
 +
    PerformTask2();
 +
else
 +
    PerformTask();
 +
traceoff();

Latest revision as of 18:43, 31 July 2023

void traceon()

Usage[edit]

Starts printing the statements the VM is executing to the console. Useful for debugging code to see what exact steps it's taking. Paired with traceoff() to disable statement printing.

Example[edit]

// Verify which path the code is executing at a branch
traceon();
if (self.count == 3)
    PerformTask2();
else
    PerformTask();
traceoff();