-
Hey Colleges!!!
I have this question that's REALLY consuming me time!
I have this module where i made a Public type with 2000 "sub variables":
Public type Var1
v1 as long
v2 as long
v3 as long
...
end type
Each variable has 3 numbers separated with "," .
What i want to do is write a simple way of taking the values i put into each of the 2000 variables
Thats because i need to put the 3 numbers in a vb function, this is what i tryed:
For i = 1 To 2000
ii = 0 + 50
Dim a, b, c As String
a = Mid(Var1.v(i), 1, 4)
b = Mid(Var1.v(i), 5, 4)
c = Mid(Var1.v(i), 9, 4)
Picture1.PSet (0, ii), RGB(a, b, c)
Next
This doesn't work, and i wouldn´t like to write 2000 times the same code to take the values!
I appreciate any kind of help!
Thanks a lot guys!!
-
:confused: WHATTT??? WOOOWW?? :confused:
You want to use 2000 variables???
hmm.. this doesn't seem to cool...
Use an array instead...
oh and
Dim a, b, c As String
is a realllll bad thing..
because a and b are declared as variants (which is not good in this case if you have alot of them :))
use
Dim a As String, b As String, c As String
instead, but to keep it clean
use
Dim a$, b$, c$
-
And i'm planning to use more variables, lol, but anyway,
if i use an array can i use the code i wrote? but if i do so i put the array where? Cause i need to make em accessable throught the program...
Thanks again!
Awaiting reply... Login OFF
-
How about an array of longs:
Code:
Public type Var1
v(1999) as long
End type