and i would change this
DIM carx(15)
carx(1)=-4
carx(2)=4
carx(3)=5
carx(4)=-7
carx(5)=10
carx(6)=-3
carx(7)=-2
carx(8)=-8
carx(9)=0
carx(10)=12
carx(11)=5
carx(12)=-3
carx(13)=1
carx(14)=-8
carx(15)=-6
DIM carz(15)
carz(1)=1
carz(2)=1
carz(3)=3
carz(4)=3
carz(5)=4
carz(6)=4
carz(7)=5
carz(8)=5
carz(9)=6
carz(10)=6
carz(11)=7
carz(12)=7
carz(13)=8
carz(14)=8
carz(15)=9
to
restore datx
for c=1 to 15
read v
carx(c)=v
next c
restore datz
for c=1 to 15
read v
carz(c)= v
next c
`outside and below main loop.
datx:
data -4,4,5,-7,10,-3,-2,-8,0,12,5,-3,1,-8,-6
datz:
data 1,1,3,3,4,4,5,5,6,6,7,7,8,8,9
Makes it easier if you ever need to read in the data again. Or, to add new data you just have to restore to a new data line.
of course you can combine the loops and data together to read X and Z; and the above initialization of car(c).
than just
restore dataxz
for c=1 to 15
read v: read w
car(c)=c
carx(c)=v
carz(c)=w
next c
rem after the main loop.
end
dataxz:
rem stagger the value for V and W
data -4,1,4,1,5,3,-7,3 etc...
lastly, It could be made into a function.
Note: I have had times where the above gives a compiler error. Can't remember if it was DBC only. I don't know fully why this happend. In those circumstances I found that I had to assign the read to a variable first.
eg.
read v
anum=v
carx(c)=anum
~zen