Klaus wrote: ↑Wed Mar 28, 2018 11:54 amHi friends,
"doMenu" is SOOOOO 90s and should not be used anymore in favour of a modern programming concept!
Instead of having something like this in your menu(s):Put this into the stack script:Code: Select all
on meupick tPickedItem switch tItem case "Backup" do this... do that... get that... set that one over there... etc. etc... break case "wahtever"... ...
Then you have a clean and easily manageable menu like:Code: Select all
command mybackuphandler do this... do that... get that... set that one over there... etc. etc... end mybackuphandler
And you can use it hasslefree in any button:Code: Select all
on meupick tPickedItem switch tItem case "Backup" mybackuphandler break case "wahtever"... ...
You get the picture.Code: Select all
on mouseup mybackuphandler end mouseup
Best
Klaus
100% in agreement. I remember buying HyperCard at a local store when it was first released ($79? 1987? - before Apple bundled it with all Macs) and wrote two "apps" for my company - one was an intraoffice messaging system (this was before eMail was common) and the other was a labor estimation app based upon Time-Motion studies in the sewing industry. That's why I dabble in Livecode; I'd like to reproduce my labor estimation app in LC (eventually).Klaus.
Get with it, man.
"doMenu" is soooo 80's.
Craig
In an earlier post in this thread I wrote:
...so I arrived at Klaus' recommendation after it became obvious that doing so would permit me to call script handlers from the menus -and- make things much easier to code and debug.I've moved the Backup handler to be a stack script so the menu item "Backup" simply calls that handler. From the File menu item (Quit) that needs to call the Backup procedure before quitting, I just used the handler name rather than calling the Backup menu item (with the process failing) and it worked fine. Well, that's a simple solution and I think I'll implement that for the rest of the menu items (make stack handlers of them).
Thanks to all,
Barry