View Full Version : -on1 flag syntax brain fart

12 December 2003, 04:12 AM
Hey guys, been working on a script for a long time here, beginning to lose focus i think...heh...

What is the proper way to embed a string into an -on1 flag on a radio button? I need to have the radio button assign a string to a global variable upon being selected, and then print that global variable. Do i need to use an intermediate variable? How do i go about this since even doing that will require me to have the actual string text within the -on1 flag?

I have two radio buttons that each need to do this....

Sample code:

radioButtonGrp -numberOfRadioButtons 2 -label "What Type?" -labelArray2 "TypeOne" "TypeTwo" -on1 "$gType = "Type One"; print $gType;" -on2 "$gType = "Type Two"; print $gType;"


12 December 2003, 06:51 AM
you just forgot to escape your quotes:

radioButtonGrp -numberOfRadioButtons 2 -label "What Type?" -labelArray2 "TypeOne" "TypeTwo" -on1 "$gType = \"Type One\"; print $gType;" -on2 "$gType = \"Type Two\"; print $gType;"

that *should* work for ya. ;)

12 December 2003, 05:08 PM
I knew it was something simple i was forgetting...thanks! :beer:

CGTalk Moderation
01 January 2006, 11:00 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.