Answer Dialog with variable buttons

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
mimu
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 76
Joined: Tue Mar 05, 2013 7:00 pm
Contact:

Answer Dialog with variable buttons

Post by mimu »

May idea is to build a variable string in tdialog to get an answer dialog with 1 , 2 ,3,4 or 5 buttons

how do i escape the string correctly to get 3 buttons in this example?

on mouseUp
put "button1" into t1
put "button2" into t2
put "button3" into t3
put t1 && "or" && t2 "or" && t3 into tdialog

answer "What to do" with tdialog
end mouseUp
Klaus
Posts: 14324
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Answer Dialog with variable buttons

Post by Klaus »

Hallo Berliner Pflanze,

this is a case for DO, tested and works:

Code: Select all

on mouseUp 
   put "button1" into t1
   put "button2" into t2
   put "button3" into t3
   put t1 && "or" && t2 && "or" && t3 into tdialog
   put QUOTE & "What to do:" & QUOTE  into tQ
   do ("answer" && tQ && "with" && tdialog)
end mouseUp
Best

Klaus
mimu
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 76
Joined: Tue Mar 05, 2013 7:00 pm
Contact:

Re: Answer Dialog with variable buttons

Post by mimu »

Super, Vielen dank
jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7423
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

Re: Answer Dialog with variable buttons

Post by jacque »

This works too, without "do":

Code: Select all

put "button1" into t1
put "button2" into t2
put "button3" into t3
answer "test dialog" with t1 and t2 and t3
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
Post Reply