Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

radio buttons

Status
Not open for further replies.

Kryolla

Technical User
Dec 6, 2001
35
can somebody send me a sample script they use for radio buttons I am confused on how to write code for this..Thanks

da_ru_tsk@hotmail.com
 
Here is the example script from the discussion of the radiogroup command in the ASPECT help file:

proc main
integer Choice ; Used for radio button group.
integer Event ; Dialog box event.

dialogbox 0 0 0 100 50 11 "Choose One"
radiogroup 1 Choice ; Define radio group.
radiobutton 2 5 5 90 12 "&Green"
radiobutton 3 5 20 90 12 "&Red"
endgroup
pushbutton 4 25 35 50 15 "&Done"
enddialog
while 1
dlgevent 0 Event ; Get dialog box event.
switch Event ; Evaluate the event.

case 0 ; No event occurred.
endcase
case 1 ; Radio group control selected.
endcase
default ; Exit case selected.
exitwhile ; Exit the while loop.
endcase
endswitch
endwhile
dlgdestroy 0 CANCEL ; Destroy the dialog box.
if Choice == 2 ; Evaluate radio group state.
usermsg "Green!"
else
usermsg "Red!"

endif
endproc

You might also want to take a look at the discussion of the radiogroup and radiobutton commands in the ASPECT help file. If you are having problems visualizing the UI in the ASPECT Editor, you can create your dialog using Procomm's dialog editor (Tools | Script Tools | Dialog Editor). After you have the dialog the way you want, you can save it to a .was file (or .wud), then include that code in your main script.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top