budgie
2006-02-13 11:07:18 UTC
Maybe I'm having a really bad night, but I'm stumped.
As a (very) occasional VBDOS user, I have a control array with N option buttons.
At the end of user selection, the index value can obviously be anything from 1
to N (I don't use zero). But when it comes to putting the final index value
into a variable,I can't find an elegant way, and I am stuck with
IF Option2(1).Index =true THEN X=1
IF Option2(2).Index =true THEN X=2
IF Option2(3).Index =true THEN X=3
IF Option2(4).Index =true THEN X=4
IF Option2(5).Index =true THEN X=5
.......
or an equally inelegant CASE SELECT scenario.
Obviously I could run a loop testing for true, but surely there is a generic way
to somehow say X = Option2.Index in one line.
Suggestions? Be gentle, I get near VBDOS about once every several years.
As a (very) occasional VBDOS user, I have a control array with N option buttons.
At the end of user selection, the index value can obviously be anything from 1
to N (I don't use zero). But when it comes to putting the final index value
into a variable,I can't find an elegant way, and I am stuck with
IF Option2(1).Index =true THEN X=1
IF Option2(2).Index =true THEN X=2
IF Option2(3).Index =true THEN X=3
IF Option2(4).Index =true THEN X=4
IF Option2(5).Index =true THEN X=5
.......
or an equally inelegant CASE SELECT scenario.
Obviously I could run a loop testing for true, but surely there is a generic way
to somehow say X = Option2.Index in one line.
Suggestions? Be gentle, I get near VBDOS about once every several years.