Sample code below:
Code: Select all
QDN.i = 5
Structure Date_Items
DOE.l
DOW.b
DOM.b
DOY.w
WOY.b
MOY.b
EndStructure
Structure Base_Record
DI.Date_Items
Array Ball_G1.b(QDN)
Ball_G2.b
Array Hits_G1.w(QDN)
Hits_G2.w
Array Freq_G1.f(QDN)
Freq_G2.f
ESN.i
GameName.i
EndStructure
Global NewList Game.base_record()
AddElement(Game())
If Game() <> 0
REC_Counter = REC_Counter + 1
Field_Counter = Field_Counter + 1
Debug REC_Counter
Debug Field_Counter
With Game()
\Ball_G2 = 0
\Hits_G2 = 0
\DI\DOE = 0
\DI\DOM = 0
\DI\DOW = 0
\DI\DOY = 0
\DI\MOY = 0
\DI\WOY = 0
\GameName = 0
For x = 0 To QDN
Debug x
Debug QDN
\Ball_G1(x) = 0 ; <- get error here = Array index out of bounds
\Hits_G1(x) = 0
Next x
EndWith
EndIf
I have spent 3 days tracking this down to just this bit of code.
The really odd part is that if I disable the debugger, it works here but my main program just hangs (think it is a different issue for the hang).
I have tried using the search function in the forum with no luck.
What am I missing or doing wrong?