BadProgrammer
Newcomer
- Joined
- Mar 13, 2009
- Messages
- 3
First I apologize if this has been answered elsewhere, but I have looked and have yet to find anything. I also apologize b/c i've only been programming in VB for less than 6 months and am probably doing things very wrong.
Below is a snippet of code im trying to get to run:
My problem is as i do the loop, the ca1co and ca1so values change, but I never call those variables anymore in the loops. I need a way to keep the ca1co and ca1so values the same. The chas, spin, ca1c, and ca1s values can and should all change throughout the loops.
any ideas? I tried arraylist.clear in the line before 'next trav' but then the variables are gone in the next iteration of the loop. i tried to redim but i got an error about needing to give the array size?!?! i cant move forward in my code until i figure this issue out.
Thanks!
Below is a snippet of code im trying to get to run:
Visual Basic:
Dim ca1co As New ArrayList
Dim ca1so As New ArrayList
Dim chas As New ArrayList
Dim spin As New ArrayList
Dim ca1c As New ArrayList
Dim ca1s As New ArrayList
' Control Arm 1 Chassis Points
ca1co.Add(TextBox1.Text - TextBox33.Text)
ca1co.Add(TextBox10.Text - TextBox32.Text)
ca1co.Add(TextBox15.Text - TextBox31.Text)
' Control Arm 1 Spindle Points
ca1so.Add(TextBox30.Text - TextBox33.Text)
ca1so.Add(TextBox25.Text - TextBox32.Text)
ca1so.Add(TextBox20.Text - TextBox31.Text)
' Call length function
chas = ca1co
spin = ca1so
dlink1 = Length(chas, spin)
dlink = dlink1
errorig1 = errorigsum(dlink)
tstart = TextBox34.Text
tend = TextBox35.Text
For trav = tstart To tend Step tstart
Dim chast As New ArrayList
Dim spint As New ArrayList
' Link 1 Chassis Movement
chast = ca1co
spint = ca1so
dlink = dlink1
dlinkt1 = chasmove(chast, spint, trav)
errt1 = errmove(dlink, dlinkt1)
'Reset variables for more looping
ca1c = ca1co
ca1s = ca1so
Next trav
any ideas? I tried arraylist.clear in the line before 'next trav' but then the variables are gone in the next iteration of the loop. i tried to redim but i got an error about needing to give the array size?!?! i cant move forward in my code until i figure this issue out.
Thanks!
Last edited by a moderator: