Changing Button Labels with script - Solved
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Changing Button Labels with script - Solved
How do you change Button Labels with script?
The script below does not work, Why?
set the label of Button1 to "David"
Thanks,
David
The script below does not work, Why?
set the label of Button1 to "David"
Thanks,
David
Last edited by DR White on Thu Sep 19, 2013 2:57 am, edited 1 time in total.
Re: Changing Button Labels with script
Sorry to be such a bother!
After looking at some more examples and beating my head against the wall, I saw my error.
The code should have been:
set the label of button Button1 to "David"
After looking at some more examples and beating my head against the wall, I saw my error.
The code should have been:
set the label of button Button1 to "David"
Re: Changing Button Labels with script
Good work.
Do you see that the first script was syntactically correct? But that it changed the label of a button you were not interested in? Did you see that label change, and did that give you a clue as to what you really needed?
Craig Newman
Do you see that the first script was syntactically correct? But that it changed the label of a button you were not interested in? Did you see that label change, and did that give you a clue as to what you really needed?
Craig Newman
Re: Changing Button Labels with script
Hi David,
check these great stacks to get the "grips" of Livecode
http://www.hyperactivesw.com/revscriptc ... ences.html
Best
Klaus
check these great stacks to get the "grips" of Livecode

http://www.hyperactivesw.com/revscriptc ... ences.html
Best
Klaus
Re: Changing Button Labels with script
I didn't see the error immediately either -- which is why I try not to name objects starting with their type. I.e., I avoid names like "button1" because when I read it I don't notice any problem. If I name it something descriptive like "Next page" then the missing object specifier is easy to spot. It's kind of too bad the IDE does that sort of naming by default. I always change them.
Sometimes I do want the object type in the name though. In those cases I put it at the end: "editingFld" or "firstnameLbl" to avoid trip-ups.
Sometimes I do want the object type in the name though. In those cases I put it at the end: "editingFld" or "firstnameLbl" to avoid trip-ups.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
Re: Changing Button Labels with script
Well, now that I read it correctly...
So you got an error. I thought is was "button 1", when in fact it was "button1". You did not have an object identifier, only a name.
You could do something to "button 1" (the first button). But you need to specify what object "button1" is. Could be a field.
Craig
So you got an error. I thought is was "button 1", when in fact it was "button1". You did not have an object identifier, only a name.
You could do something to "button 1" (the first button). But you need to specify what object "button1" is. Could be a field.
Craig
Re: Changing Button Labels with script
Craig,
Thanks for your following of my posts and your understanding
.
The "Button1" is not a good name in a real program,
I am just writing a test program to explore what LiveCode can do in my current project to develop an mobile app for my Sunday school class.
David
Thanks for your following of my posts and your understanding

The "Button1" is not a good name in a real program,
I am just writing a test program to explore what LiveCode can do in my current project to develop an mobile app for my Sunday school class.
David