Long Variable Name as Array Element

Scott Walker scottw1 at alltel.net
Wed Aug 18 14:16:59 PDT 2004


> Scott Walker,
> 
> You wrote Tuesday, August 17, 2004 9:26 PM
> Subject: Long Variable Name as Array Element
> 
> 
> > Ken,
> > 
> > I've stripped this down to a simple example.  No sort select 
> > processing. No automatic processing.  No dependence on any 
> data from 
> > any of the records actually being processed.  Only 7 lines 
> of code in 
> > output prc table.  Nothing on any "IF" lines.
> > 
> > Filepro version 5.0.13 rreport.
> > 
> > 
> > 1 dim Category_Sell[7](12,,2)
> > 
> > 2 declare local Counter(1,.0)
> > 
> > 3 Counter="1"
> > 
> > 4 cr(1,.0)="1"
> > 
> > 5 Category_Sell[cr]=Category_Sell[cr]
> > 
> > 6 Category_Sell[Counter]=Category_Sell[Counter]
> > 
> > 7 end
> > 
> >  
> > 
> > Hopefully we are all in agreement that line 5 and line 6 should be 
> > functionally identical, right?
> > 
> > When I run the above code, it works fine!
> > 
> > Now what I think is causing the bug:
> > 
> > On line 1, map the array to some dummy variables, so the 
> code becomes:
> > 
> > 1 dim Category_Sell[7](12,,2):aa
> > 
> > 2 declare local Counter(1,.0)
> > 
> > 3 Counter="1"
> > 
> > 4 cr(1,.0)="1"
> > 
> > 5 Category_Sell[cr]=Category_Sell[cr]
> > 
> > 6 Category_Sell[Counter]=Category_Sell[Counter]
> > 
> > 7 end
> > 
> > 
> > When you run it you get this error:
> > 
> > *** A filePro Error Has Occurred ***
> > 
> > Array Index Out of Range:  dim category_sell(7) -- Index: 0
> > 
> > Output Processing
> > Line Number: 6
> > Process contains a syntax error at position indicated.?
> > 
> > How can this not be a bug if line 5 runs fine and line 6 
> bombs if they 
> > both are supposed to be functionally the same thing?
> > 
> > Can anyone duplicate this error?
> > 
> > Regards,
> > Scott
> > 
> Duplicated with 5.0.13
> 
> Incident a1-081904-1 assigned.
> 
> Internal Task#763 applies.
> 
> Thanks for the input Scott
> 
> Ray Hoover


Ray,

THANK YOU.  I was beginning to doubt my sanity.

Regards,


Scott



Scott Walker
RAM Systems Corp.
PO Box 1778
Davidson, NC 28036
Ph: (704) 896-6549
Fx: (704) 896-7458
Email:  scottw1 at alltel.net 
> 




More information about the Filepro-list mailing list