Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Debugger?



I accomplish something similar by using a simple Find/Replace to "comment out" the debugging dialogs and logs or "un-comment out" them.

display dialog "Debug: " & variableToCheck

Can then do Find: display dialog "Debug:
and replace with: -- display dialog "Debug:

in one step they're toggled. Can do the same with log.

I've even used schemes for long scripts that allow the choice of between levels of debugging.
display dialog "Debug Main: " & variableToCheck
display dialog "Debug Sub1: " & variableToCheck
display dialog "Debug Sub2: " & variableToCheck
display dialog "Debug Events: " & variableToCheck
etc.

Then, with simple change alls, I can turn on and off debugging display dialogs for different levels/parts of the script.

Cheers,
Joe Weaks


On Tuesday, August 12, 2003, at 08:00 AM, klaus umland wrote:

To keep the effort of logging at a minimum, I'd suggest to break down the
logging itself into a handler, like

property doLog:true
property doBreak:true

on LogIt(logWhat)
if doLog is true then
log logWhat
end if
end LogIt

on BreakIt(TellMe)
if doBreak is true then
display dialog TellMe
end if
end BreakIt

That way, logging and breaking could be turned on an off just by setting the
properties. No need to out comment any log or display dialog.
_______________________________________________
applescript-studio mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-studio
Do not post admin requests to the list. They will be ignored.

References: 
 >Re: Debugger? (From: klaus umland <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.