  | | | Subject: -on1 syntax brain fart | Subject: -on1 syntax brain fart 2003-12-17 - By Doug Meyer
Back Of course, knew it was something simple I was forgetting....thanks!
Doug
n 12/16/03 1:20 AM, "Ben Wronsky" <ben@(protected)> wrote:
> Hi Doug, > > Add escape characters (\) before the embedded quotes - quotes that appear in > between the string's quotes: > > global string $gType; > > radioButtonGrp > -numberOfRadioButtons 2 > -label "What Type?" > -labelArray2 "TypeOne" "TypeTwo" > -on1 "$gType = \"Type One\"; print $gType;" > -on2 "$gType = \"Type Two\"; print $gType;" > radioButtonTest; // name it in case u want to reference it... > > (OR) > > You could hookup each onX to a proc (which gives you more flexibility - I > think) such as: > > radioButtonGrp > -numberOfRadioButtons 3 > -label "What Type?" > -labelArray3 "TypeOne" "TypeTwo" "TypeThree" > -on1 "testProc 1" > -on2 "testProc 2" > -on3 "testProc 3" > rBtnTest; > > global proc testProc( int $which ) > { > global string $gType; > > switch($which) { > case 1: > $gType = "Type One"; > break; > case 2: > $gType = "Type Two"; > break; > case 3: > $gType = "Type Three"; > break; > } > print($gType + "\n"); > } > And there are other solutions as well... Good luck. > > ---- > .ben > > -- --Original Message-- -- > From: maya-bounce@(protected) [mailto:maya-bounce@(protected)] On Behalf > Of Doug Meyer > Sent: Monday, December 15, 2003 7:58 PM > To: Maya high end listserve > Subject: -on1 syntax brain fart > > 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;" > > > Thanks > > Doug Meyer > > > -- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- --- > List-help: <mailto:listar@(protected)?Subject=help> > List-unsubscribe: <http://www.highend3d.com/maya/listserver/> > List-subscribe: <http://www.highend3d.com/maya/listserver/> > List-archive: <http://www.highend3d.com/maya/archive/> > > --- > > > > > -- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- --- > List-help: <mailto:listar@(protected)?Subject=help> > List-unsubscribe: <http://www.highend3d.com/maya/listserver/> > List-subscribe: <http://www.highend3d.com/maya/listserver/> > List-archive: <http://www.highend3d.com/maya/archive/> >
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- --- List-help: <mailto:listar@(protected)?Subject=help> List-unsubscribe: <http://www.highend3d.com/maya/listserver/> List-subscribe: <http://www.highend3d.com/maya/listserver/> List-archive: <http://www.highend3d.com/maya/archive/>
|
|
 |