joe_pool_is
Well-known member
Ive got a VB question which *should* be easy ... if you know how to solve it.
Currently, my code uses a multi dimentional array:
This is short and easy, but every element of the array has to be the same datatype (all integers, all strings, etc.).
To fix this, I want to use a class:
etc.
How can I use this in my loop now?
See my problem? How can I replace xx with i? I tried this:
but that did not work. Also, I tried to declare an array of classes, but that did not work either:
Any thoughts or suggestions? Anyone?
~Joe
Currently, my code uses a multi dimentional array:
Code:
dim Position as short = 0
dim IsOn as short = 1
for i = 0 to (whatever)
switcher(i, Position) = this
switcher(i, IsOn) = that
next
This is short and easy, but every element of the array has to be the same datatype (all integers, all strings, etc.).
To fix this, I want to use a class:
Code:
class SwitchClass
public Position as String
public IsOn as Boolean
end Class
Private SD01 as New SwitchClass()
Private SD02 as New SwitchClass()
How can I use this in my loop now?
Code:
for i = 0 to (whatever)
SDxx.Position = This
SDxx.IsOn = False
next
See my problem? How can I replace xx with i? I tried this:
Code:
SD{Convert.ToString(i).PadLeft(2, 0)}.Position = This
Code:
Private SD() as new SwitchClass()
~Joe