Grouped radio button - driving me nuts
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
-
- Posts: 32
- Joined: Sun Jun 22, 2014 2:37 am
Grouped radio button - driving me nuts
This seems like a simple thing to do but I keep getting errors. I have two radio buttons, grouped and named "radioGroupProfit". All I want to do is to get the value (name) of selected button. I use the selected button to change a simple calculation based on the selected button. However, I am having trouble getting the selected radio button within the group. To test, I have used the following statement:
answer hilitedbuttonname of radioGroupProfit
I keep getting an error Object Expression. I have tried in pro 6.5 and community 6.7 dp 6 and get the same error. Advice?
answer hilitedbuttonname of radioGroupProfit
I keep getting an error Object Expression. I have tried in pro 6.5 and community 6.7 dp 6 and get the same error. Advice?
-
- Livecode Opensource Backer
- Posts: 447
- Joined: Mon Jan 23, 2012 12:46 pm
Re: Grouped radio button - driving me nuts
Try this in the group script:
Code: Select all
on mouseup
answer the target
end mouseup
Re: Grouped radio button - driving me nuts
Hi Jackie,
you used a "crippled" syntax, which cannot work because you did not address the target correctly!
If in doubt, please check the dictionary!
You are addressing a GROUP so you need to tell LC so, and ALWAYS put object names in QUOTES!
Did I say ALWAYS!
Best
Klaus
you used a "crippled" syntax, which cannot work because you did not address the target correctly!
If in doubt, please check the dictionary!
Code: Select all
## Bad:
## answer hilitedbuttonname of radioGroupProfit
## Good:
answer THE hilitedbuttonname of GROUP "radioGroupProfit"
Did I say ALWAYS!

Best
Klaus
-
- Posts: 32
- Joined: Sun Jun 22, 2014 2:37 am
Re: Grouped radio button - driving me nuts
Thanks Klaus and others. Too many years of VB, and C.
-
- Posts: 32
- Joined: Sun Jun 22, 2014 2:37 am
Re: Grouped radio button - driving me nuts
Hi again Klaus. I noticed you told me to reference the Library. Perhaps I am doing something wrong, but when I look at the library, the Radio Button object is not even in the library.
Re: Grouped radio button - driving me nuts
Hi.
I do not see where klaus mentioned "library". But in any case, until you become more familiar with LC, keep the dictionary setting on "all". You get everything that way, including closely related words. These are valuable clues in many cases.
Also, when you do find a word that fits your needs, always look in the "see also" paragraph. Lots of opportunities there.
Craig Newman
I do not see where klaus mentioned "library". But in any case, until you become more familiar with LC, keep the dictionary setting on "all". You get everything that way, including closely related words. These are valuable clues in many cases.
Also, when you do find a word that fits your needs, always look in the "see also" paragraph. Lots of opportunities there.
Craig Newman
Re: Grouped radio button - driving me nuts
Hi Jackie,
Best
Klaus
but "hilitedbutton" and "hilitedbuttonname" are in the dictrionary and there the correct syntax is definitively explained!JackieBlue wrote: I noticed you told me to reference the Library. Perhaps I am doing something wrong, but when I look at the library, the Radio Button object is not even in the library.

Best
Klaus
-
- Posts: 32
- Joined: Sun Jun 22, 2014 2:37 am
Re: Grouped radio button - driving me nuts
Yes, but why would a property be looked up? The only reason I found that property was due to another forum post. My first inclination would be to look up the object, which is not in the dictionary. I am running into a similar issue in looking up the events (messages) that can be raised. The documentation seems to be silent on a comprehensive list.
Re: Grouped radio button - driving me nuts
To read how they are used in a context? Or simply to know a bit more about it?JackieBlue wrote:Yes, but why would a property be looked up?
Curiosity anyone?

Even after 15 years of working with Livecode and its ancestors I still doublecheck my syntax
against the dictioanry, when it does not work as exspected!
YMMV
