Page 1 of 1

Noob question - put into field without erasing text?

Posted: Wed Jun 18, 2014 7:56 pm
by TubooBokBok
Hello. I am new to Live code and have a question.

I have two buttons, when button 1 is clicked it will display 1 on a label, and likewise when button 2 is clicked it will display 2 on the label.

I want it so when you press button 1 then button 2 it will display 12 on the label, however at the moment the 2 will erase to 1 so only 2 will be displayed.

I am using the code

Code: Select all

put "1" into field Answer
How would I change this so the buttons just add the new text instead of overriding the previous text?

I hope this makes scene, and thanks in advance for any help.

Re: Noob question - put into field without erasing text?

Posted: Wed Jun 18, 2014 8:29 pm
by Klaus
Hi TubooBokBok,

1. welcome to the forum! :D

2. You can put text BEFORE, INTO and AFTER a field (or text in a field)!
So you need to:
...
put 2 AFTER fld "answer"
## Always use QUOTES around object names!
...

You might want to check these great stack to get the basics of Livecode:
http://www.hyperactivesw.com/revscriptc ... ences.html

Best

Klaus

Re: Noob question - put into field without erasing text?

Posted: Wed Jun 18, 2014 8:32 pm
by TubooBokBok
Thank you very much for your help :D