debug keyword

darkbeer

Beer is Good!
Reaction score
84
well, i often saw the word debug before some calls like BJDebugMsg(), in some codes, but i wasnt able to find out what it actually does.

so when i have a code like this:
JASS:
if i == 10 then
    debug BJDebugMsg("debugging")
    return
endif


or whatever, when does the message show up?, what does the debug codeword do??

thx in advance
 
Reaction score
456
Debug preprocessor

Jass includes a debug keyword which compiles correctly but makes the rest of the code be ignored. It seemed this keyword was used for debugging purposes like a switch in a debug build of warcraft III that enabled those calls.

We can now take advantage of this hidden Jass feature. Saving a map in debug mode using JassHelper will simply remove the debug keyword so the calls are enabled, if debug mode is not enabled, JassHelper will remove the lines that begin with debug.
function Something takes integer a returns nothing
debug call BJDebugMsg("a is "+I2S(a))
call KillNUnits(a)
endfunction

If we use this function in a map saved with debug mode, we will see "a is value" each time this function is called, otherwise it will only call KillNUnits silently.

Straight from the manual.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top