break on $options = "Red","Yellow","Blue","Green","Orange","Black" $prompt = "Please select a color from the list below:" $choice = optionbox($prompt,$options) ?"choice = " $choice exit 1 Function OptionBox($prompt,$options) dim $form,$label,$ok,$cancel dim $i,$top dim $radio[ubound($options)] dim $option $form = createobject("kixtart.form") $form.scalewidth = 400 $form.scaleheight = 100 $form.fontsize = 12 $form.tag = 0 $label = $form.label($prompt) $label.top = 20 $label.left = 20 $label.width = $form.scalewidth-$label.left-20 $label.height = 30 $i = 0 $top = $label.bottom + 10 for each $option in $options $radio[$i] = $form.optionbutton($option) $radio[$i].left = $label.left + 20 $radio[$i].top = $top $radio[$i].onclick = "$$option=$i" $top = $top + 30 $i=$i+1 next $ok = $form.commandbutton("OK") $ok.left = 110 $ok.top = $top+30 $ok.width = 80 $ok.height = 25 $ok.onclick = "$$form.tag=1" $cancel = $form.commandbutton("Cancel") $cancel.left = $ok.right + 20 $cancel.top = $top+30 $cancel.width = 80 $cancel.height = 25 $cancel.onclick = "$$form.tag=2" $form.height = $ok.bottom + 40 $form.center $form.show while $form.visible and $form.tag = "0" $=execute($form.doevents) loop if $form.tag = "1" $optionbox = $option else $optionbox = -1 endif $form = 0 endfunction