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: 9647
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: building an answer string programmatically

Post by dunbarx » Thu Jan 14, 2021 12:45 am

@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: 2718
Joined: Sat Dec 22, 2007 5:35 pm
Location: Genève
Contact:

Re: building an answer string programmatically

Post by jmburnod » Thu Jan 14, 2021 12:50 am

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: 7228
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: building an answer string programmatically

Post by jacque » Thu Jan 14, 2021 5:27 pm

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: 9647
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: building an answer string programmatically

Post by dunbarx » Thu Jan 14, 2021 6:42 pm

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: 7228
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: building an answer string programmatically

Post by jacque » Fri Jan 15, 2021 6:31 pm

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

Return to “Getting Started with LiveCode - Experienced Developers”