Shippwreck
Programmer
Hi,
This is a question to which i have an answer but it is by far not the best. Here goes:
I want to use an one array to look up values in others, ie
Num1 = 0
Num2 = 0
Array1 = array("Pink", "Orange", "END")
Pink = array("1", "2", "3", "END")
Orange = array("4", "5", "6", "END")
Do until Target1 = "END"
Target1 = Array1(Num1)
*******
Do until Target2 = "END"
Target2 = Target1(Num2)
MsgBox Target2
Num2 = Num2 + 1
Loop
Num1 = Num1 + 1
Loop
Now the above is what i want to do except it doesn't work unless you add the following in where the stars are:
If Target1 = "Pink" then
Target1 = Pink
Else
If Target1 = "Orange" then
Target1 = Orange
End If
End If
When you put that in it works but if the first array is very large then its a hell of a lot of work to right out a huge long nested if (not to mention bad programming practice)
So if anyone has any ideas on how to sort this then please let me know.
Thanks for your help
This is a question to which i have an answer but it is by far not the best. Here goes:
I want to use an one array to look up values in others, ie
Num1 = 0
Num2 = 0
Array1 = array("Pink", "Orange", "END")
Pink = array("1", "2", "3", "END")
Orange = array("4", "5", "6", "END")
Do until Target1 = "END"
Target1 = Array1(Num1)
*******
Do until Target2 = "END"
Target2 = Target1(Num2)
MsgBox Target2
Num2 = Num2 + 1
Loop
Num1 = Num1 + 1
Loop
Now the above is what i want to do except it doesn't work unless you add the following in where the stars are:
If Target1 = "Pink" then
Target1 = Pink
Else
If Target1 = "Orange" then
Target1 = Orange
End If
End If
When you put that in it works but if the first array is very large then its a hell of a lot of work to right out a huge long nested if (not to mention bad programming practice)
So if anyone has any ideas on how to sort this then please let me know.
Thanks for your help