Hi -
I am trying to create a lookup table using an array of values, as described in Appendix 2 of the Programming Guide.
When I test the program, everything appears ok; however, when I try it in preview mode, I get the message "[b]Array index overflow.[/b]"
Here's the programming I am using in global code:
[code] stat LU1 as array[169,2] of String
LU1[1,1]="Air-Fresheners";LU1[1,2]="12" LU1[2,1]="Aluminum-Foil";LU1[2,2]="11" etc for LU1[3,1] through LU1[167,1] LU1[168,1]="Wines";LU1[168,2]="18" LU1[169,1]="Yeast";LU1[169,2]="5" [/code]
And here's the programming I am using in Category::On Element Exit
[code] var i as Int var foundit as String
If Category <> "" Then { For i = 1 to 169 If LU1[i,1] = Category Then { Aisle = LU1[i,2] foundit = "yes" i = 169 Throwfocus(Qty) }
Next If foundit <> "yes" Then { @Msgbox("'" + Category + "' not found in table.","","") Clear(Category) Goto Category } }
[/code]
So [b][i]now[/i][/b] where am I going wrong?
I would love to get this done before I go to sleep tonight, and I'm ready to go to sleep. So, if anyone is out there with a "solution," I would appreciate hearing from you.
Also, if there is an alternative approach that you think would be better in this situation, I would like to hear it.
Thanks!
|