User:WrGodLikeBeing Resident/debug

From Second Life Wiki
< User:WrGodLikeBeing Resident
Revision as of 05:57, 6 August 2013 by WrGodLikeBeing Resident (talk | contribs) (Created page with "{{LSL Header}} This is an example of how you can embed debugging information in your code, and switch it off without having to remove it all <lsl> integer DEBUG = TRUE; // set fa…")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

This is an example of how you can embed debugging information in your code, and switch it off without having to remove it all <lsl> integer DEBUG = TRUE; // set false to turn off debugging

debug( string text ){

  if( DEBUG ) llOwnerSay( text );

}

default {

   state_entry(){
       debug( "This is only displayed when DEBUG is TRUE" );
       llSetTimerEvent(5.0);
   }
   timer(){
       debug("Wake Up!");
       if( !DEBUG ) llSetTimerEvent(0.0);
   }

} </lsl>