executing a case statement from an external button

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: Klaus, FourthWorld, heatherlaine, kevinmiller, robinmiller

Post Reply
Tron621
Posts: 4
Joined: Tue Jul 31, 2007 5:29 pm
Contact:

executing a case statement from an external button

Post by Tron621 »

Ihave a pip up menu that I am executing a case statement based on the choices. I want to know if I can call the elemtents in the case statement from say a button whose function is to select the previous case statement from the current chosen one.
so I have a case statement

on popupbutton
switch foo

case "isfoo"
etc
etc
break
case "is isfoo"
etc
etc
break
end popupbutton


It works when I use the popup button where it resides...

I want to call case
"isfoo" from an alternate button on the card say a tnextButton

on mouseup
call the case element "isfoo"

end mouseup

does any of that make sense?
if 6 was 9 then...
FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10104
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Post by FourthWorld »

Code: Select all

dispatch "popupbutton" to btn "MyButton" with "isfoo"
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
Tron621
Posts: 4
Joined: Tue Jul 31, 2007 5:29 pm
Contact:

Case....

Post by Tron621 »

Hey I have version 2.9 there is not a dispatch command in this version.. thanks though
if 6 was 9 then...
Janschenkel
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 977
Joined: Sat Apr 08, 2006 7:47 am
Contact:

Post by Janschenkel »

In that case, revert back to the good ol' send command:

Code: Select all

put "isfoo" into tParam
send "popupbutton tParam" to btn "MyButton"
Of course you'll have to add a formal parameter to your popupbutton handler.

HTH,

Jan Schenkel.
Quartam Reports & PDF Library for LiveCode
www.quartam.com
Post Reply