Question on Radio Buttons

Phil Davis davis.phil at comcast.net
Tue Nov 22 20:38:39 EST 2005


Hi Fred -

If you just want to put the into the global, try this:

on mouseUp -- in the radio button group
   global gQuestion1
   put the hilitedButtonName of me into gQuestion1
end mouseUp

Then your original 'button script' below should work fine.


If you want to score each answer as you go, you could do this:
- set the name of each radio button to either "correct" or "wrong"
- set the label of each button to its answer text
- make your script do this:

on mouseUp -- in the radio button group
   global gQuestion1
   put the hilitedButtonName of me & cr \
     & the label of the target into gQuestion1
end mouseUp

This would put a 2-line response into gQuestion1.
- line 1 = 'correct' or 'wrong'
- line 2 = the answer they selected

There are also other ways to accomplish this or just about anything else 
you want to do.

Food for thought...

Phil Davis



Fred Giannetto wrote:
> Hello,
> 
> I am trying to store the response from a radio button group in a global 
> variable.  I have went throught the board and every remedy I try does 
> not return a value.  I have one multiple choice group and one button 
> that I am using to try to answer the result (so I can see if it is 
> processing)
> 
> 
> I have tried two different approaches
>                                      Radio Button Group
> on mouseup
>  --put the hiliteButtonName of me into gTest
>  --put the hiliteButtonID of me into gTest
>  if the target is B then put "Correct" into gQuestion1 else put "Wrong" 
> into gQuestion1
> end mouseup
> 
>                                     Button Script
> on mouseUp
>  global gQuestion1
>  --global gTest
>  --answer gTest
>  answer gQuestion1
> end mouseUp
> 
> For some reason I can not seem to grasp this concept.
> 
> Thank you
> All best Always
> Fred
> 
> 
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your 
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
> 



More information about the use-livecode mailing list