Resetting stack while debugging "on open" scripts

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: Klaus, FourthWorld, heatherlaine, kevinmiller

Post Reply
WaltBrown
Posts: 466
Joined: Mon May 11, 2009 9:12 pm
Location: NE USA

Resetting stack while debugging "on open" scripts

Post by WaltBrown » Mon May 11, 2009 9:20 pm

Hope this isn't misplaced or an RTFM question from a newbie - I am debugging scripts that execute on card and stack opening - is there a way in the IDE to recycle the script in memory to trigger the "on open" scripts without going through a Compile/Save/Close/Remove from memory/Open Recent cycle each time?

Thanks,
Walt Brown
Omnis traductor traditor

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3338
Joined: Sun Jan 07, 2007 9:12 pm
Location: Bochum, Germany

Post by bn » Mon May 11, 2009 10:42 pm

Walt,

welcome to the forum, very little RTFM going on around here, everybody remembers too well how it was to start. Though no one objects to reading the manuals either..
But feel free to ask if you get stuck, even on 'simple' things.

get the message box by issuing a "command m" (mac) or control m (windows) or go to the tools menu and choose message box.

Then try to type into the message box: opencard or openstack (or whatever handler/command you want to invoke)

The message box sends the command to the stack and the stack executes the handlers. In the case of openstack and opencard without actually opening a stack or a card. It is just like sending a comand like mouseUp to a button.

no need to close a stack and reopen it.

The message hierarchy in the user guide pdf explains this concept very well and it is easier to understand a good many things in Rev if you have a basic idea of what the message hierarchy is.

regards
Bernd

WaltBrown
Posts: 466
Joined: Mon May 11, 2009 9:12 pm
Location: NE USA

Post by WaltBrown » Mon May 11, 2009 11:31 pm

Thanks Bernd, somehow I missed that in the brief documentation.

Neat! A list of the available system globals in there as well!

I have dusted off my Danny Goodman "The Complete Hypercard" book, maybe I'll need to symbolically burn it to get rid of old assumptions. Now if I could only find a machine with a working 400k diskette drive, I'd have my code base back. Or maybe that's not a good thing. :-o

BR,
Walt
Walt Brown
Omnis traductor traditor

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7314
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Post by FourthWorld » Tue May 12, 2009 2:01 am

WaltBrown wrote:I have dusted off my Danny Goodman "The Complete Hypercard" book, maybe I'll need to symbolically burn it to get rid of old assumptions.
Keep it handy - there are some gems in there.

But while you're getting started with Rev treat yourself to this great resource:
http://www.hyperactivesw.com/mctutorial ... altoc.html
Richard Gaskin
Community volunteer LiveCode Community Liaison

LiveCode development, training, and consulting services: Fourth World Systems: http://FourthWorld.com
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/

mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2916
Joined: Mon Jan 22, 2007 7:36 am
Location: Berkeley, CA, US
Contact:

Post by mwieder » Tue May 12, 2009 2:08 am

Walt- Welcome to Revolution. It's almost better to start from scratch and not think HyperCard. In particular forget what you think you know about backgrounds - Revolution has a different and richer pardigm for these things. And for your debugging open and close handlers -as nonintuitive as it seems, the openStack, openCard sort of things should go in the script of the first card rather than in the stack script. Those messages are sent to the first card in the stack anyway, and it will keep you out of trouble later on - you don't necessarily want substacks firing the openStack handlers in their parent stack by accident.

WaltBrown
Posts: 466
Joined: Mon May 11, 2009 9:12 pm
Location: NE USA

Post by WaltBrown » Tue May 12, 2009 2:30 am

Thanks, Richard, great stuff! And MW, good thought, I'll keep that in mind - I have a couple multistack ideas fermenting.

BR,
Walt
Walt Brown
Omnis traductor traditor

mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2916
Joined: Mon Jan 22, 2007 7:36 am
Location: Berkeley, CA, US
Contact:

Post by mwieder » Tue May 12, 2009 4:46 am

Richard's being a bit modest here, too - check out www.revjournal.com and his own fourthworld.com for some more wonderful resources.

A further caveat for anyone coming from a HyperCard background: if you create a standalone app you can't modify it on the fly. This is an OS thing, not a rev thing. In HyperCard you're running the HC interpreter and executing your stack as a document, so you can save data into card fields and expect it to be there the next time you run the app. In Revolution if you create a standalone application you can't save changes. You have to save data to separate files: text files or other stack files or a database, but something other than your main stack. This is a hard one to get used to coming from HyperCard - everyone goes through a real shift in thinking when they come up against this.

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”