building an answer string programmatically

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

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10501
Joined: Wed May 06, 2009 2:28 pm

Re: building an answer string programmatically

Post by dunbarx »

@Bruce. It was me with the "do" stuff.

@Jean-Marc.
I don't suggest using "do" in my post.
You did nothing to be ashamed of. This is spiraling out of control. Bruce mistook you for me, and now you are mistaking you for "do".

Yipes.

Craig
jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2734
Joined: Sat Dec 22, 2007 5:35 pm
Contact:

Re: building an answer string programmatically

Post by jmburnod »

Bruce mistook you for me, and now you are mistaking you for "do
:D :D :D
https://alternatic.ch
jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7423
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

Re: building an answer string programmatically

Post by jacque »

I mention this because "do" constructions are considered old-fashioned
Not really, there are occasions where "do" is required and useful. The reason to avoid it when possible is because it has to load the compiler on every instance which creates unnecessary overhead. The same is true for the value function.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10501
Joined: Wed May 06, 2009 2:28 pm

Re: building an answer string programmatically

Post by dunbarx »

Jacque.
Not really, there are occasions where "do" is required
As in this case, I believe.

This is the regular "do" method, which works:

Code: Select all

on mouseUp
   put "All or Nothing or Something" into temp
   do "answer test with" && temp
end mouseUp
I recall, many years ago, that I could create another level of evaluation by modifying the "do" line. But I cannot duplicate it:

Code: Select all

on mouseUp
   put "All or Nothing or Something" into temp
   do "get" && temp
   answer "test" with it
end mouseUp
No dice. Do you know? Not that it matters, just an old, old memory,

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

Re: building an answer string programmatically

Post by jacque »

It does seem to be required in this case. I was only commenting on the reason I try to avoid using "do". I think I've only needed it a handful of times over the last several years, usually there's a way around it.

I suspect the reason your last test case fails is because the button options are missing quotes. Bernd's handler fixes that.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
Post Reply