Can Message Box retain messages?

tbodine lvhdgc7 at gmail.com
Sat May 7 12:23:49 EDT 2011


> No matter. On advice from Chris, I rolled my own Log substack as a palette
> and now send things to a handler that puts them into a field there. Works
> like a charm. 

>>Ooooh. Share.

OK, Bob. Here goes...

Be advised I'm a LiveCode newbie so everyone feel free to turn this into a
lesson on what I should have done different.

Steps to make a Log substack (Message box output alternative)
1) Make a new substack named "Log" containing a card named "Log" containing
a scrollable field named "Log"  Stretch the field to fill the card.
2) Configure those as you wish. (Mine has the stack set as a palette window,
the "Log" field's autoHilite OFF and line wrap enabled.)
3) In the mainStack of my project, I put this script:

on log thisinfo
   if thisinfo is "clear" then
      put "" into fld "Log" of stack "Log" -- empties the log
   else
      put thisinfo & RETURN after fld "Log" of stack "Log"
   end if
end log

4) Finally, for any message you want to send to the log, call the log
handler from your code:

log "my whatever"

I use this for debugging to record a breadcrumb trail of handlers and
events, and to record changes to variables over time. The one thing it isn't
doing, so far, is outputting arrays. Do I need to split those first?

Does LC have a command to evaluate the type of an object or variable? (Such
as Director's "ilk" command?)

Comments? Improvements?

Thanks,
Tom Bodine



--
View this message in context: http://runtime-revolution.278305.n4.nabble.com/Can-Message-Box-retain-messages-tp3503775p3505810.html
Sent from the Revolution - User mailing list archive at Nabble.com.




More information about the use-livecode mailing list