e: "exit to top" within modal: bug or misconception?

Richard Gaskin ambassador at fourthworld.com
Thu Mar 12 11:24:50 EDT 2009


Ben Rubinstein wrote:
> I think it's not so much that you CAN'T script around this; it's just that 
> we've all got caught in the situation where we haven't done so.   (This does 
> come up on the list from time to time.)  Most of us have probably lost 
> data/work in some instances.  And yes, in each case we could recognise that it 
> had been an error on our part.
> 
> But if such superb and experienced programmers as us can make such mistakes, 
> it seems like it might be a benefit if there was a way of letting us out of 
> those mistakes gently.

Agreed:
<http://quality.runrev.com/qacenter/show_bug.cgi?id=294>

In my own case I'll admit that I've resorted to answer dialogs for 
debugging in recent months only because I love my custom script editor 
but hadn't taken the time to integrate it with MC's debugger.  Ken and I 
worked that out (his work on MC's Variable Watcher is quite laudable), 
and since then I rarely use answer dialogs for debugging info.

If one must use answer dialogs this way (and from time to time it can be 
convenient), until we get a way to have "exit to top" honored from 
within the dialog we have to look at ways to have that available from 
the calling script.

Old habits are hard to break, so any solution will be used only to the 
degree that adopting it is easier than just continuing to run on muscle 
memory.

So I've added to my development library this handy handler:

on d s
   answer s with "Cancel" or "Continue"
   if it is "Cancel" then exit to top
end d

"d" can stand for "debuggingInfo" or "developmentOnlyAnswerDialog" or 
whatever else helps mnemonically. :)

As a single character command name, it offers me two things:

1. It stands out visually when skimming code, making it easy to 
distinguish from things I actually want to keep there.  I pretty much 
never use single-character names for anything, so when I do the white 
space around it makes it stand out very clearly.

2. It's easier to type than "answer" (five fewer characters), increasing 
the likelihood that I'll actually make the effort to remember to use it.

This isn't nearly as useful as having "exit to top" honored regardless 
where it's called from, but for a few of us lazy people who have a 
debugging task that we don't feel like stepping through the debugger to 
check it may be helpful.

--
  Richard Gaskin
  Fourth World
  Revolution training and consulting: http://www.fourthworld.com
  Webzine for Rev developers: http://www.revjournal.com




More information about the use-livecode mailing list