J
Just_a_fan
In VB6, I could easily take the value from a combo box and make a
command with it, this: baudrate = cboBaud(listindex).
With the new dotted stuff in VB9, I can't seem to do that. Here's an
example of my problem.
I have a combo box with various baud rates in it. The user selects one
and I want to use it.
However, the command to use it is in the format:
AxMbaxp1.BaudRate() = MBAXPLib.enumBaud.B9600
The ".B9600" could also be just a ".5" which I could get from the
listindex (selectedindex I think it is now) from the combo box or I
could use the B9600 from the selecteditem.tostring but I cannot figure
out how to put either on the end of such a dotted format command.
What I need is
AxMbaxp1.BaudRate() = "MBAXPLib.enumBaud." & _
cboBaud.selecteditem.tostring
This means I have to have a Select Case and run the combo box index and
pick the right command thereby increasing code bloat about 10 times what
it should be.
In general, is there any way to build up a command and avoid using the
Select Case?
If anyone remembers "REXX", this could easily be done in that language.
You just make a variable contain 5 and then issue the command with the
variable at the end. The first part was fixed and the variable was
appended at the end. In fact, IBM Assembler macro works the same way.
You can just use a LCLC and build the command up. (Sorry for dredging up
history but it seems we are losing flexibility and gaining code bloat)
Mike Morrow
MMSA00E62537
command with it, this: baudrate = cboBaud(listindex).
With the new dotted stuff in VB9, I can't seem to do that. Here's an
example of my problem.
I have a combo box with various baud rates in it. The user selects one
and I want to use it.
However, the command to use it is in the format:
AxMbaxp1.BaudRate() = MBAXPLib.enumBaud.B9600
The ".B9600" could also be just a ".5" which I could get from the
listindex (selectedindex I think it is now) from the combo box or I
could use the B9600 from the selecteditem.tostring but I cannot figure
out how to put either on the end of such a dotted format command.
What I need is
AxMbaxp1.BaudRate() = "MBAXPLib.enumBaud." & _
cboBaud.selecteditem.tostring
This means I have to have a Select Case and run the combo box index and
pick the right command thereby increasing code bloat about 10 times what
it should be.
In general, is there any way to build up a command and avoid using the
Select Case?
If anyone remembers "REXX", this could easily be done in that language.
You just make a variable contain 5 and then issue the command with the
variable at the end. The first part was fixed and the variable was
appended at the end. In fact, IBM Assembler macro works the same way.
You can just use a LCLC and build the command up. (Sorry for dredging up
history but it seems we are losing flexibility and gaining code bloat)
Mike Morrow
MMSA00E62537