Long Variable Name as Array Element

John Esak john at valar.com
Wed Aug 18 06:04:38 PDT 2004


Okay, I tried your exact code below... no error. I then tried a whole lot of
other variations... no error. So, my question now is, could you possibly
have a real field named "counter"??

John


> -----Original Message-----
> From: filepro-list-bounces at lists.celestial.com
> [mailto:filepro-list-bounces at lists.celestial.com]On Behalf Of Scott
> Walker
> Sent: Tuesday, August 17, 2004 10:26 PM
> To: 'Kenneth Brody'
> Cc: fpsupport at fptech.com; Filepro List - No spam
> 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
>
> Cc. fpsupport
> Scott Walker
> RAM Systems Corp.
> PO Box 1778
> Davidson, NC 28036
> Ph: (704) 896-6549
> Fx: (704) 896-7458
> Email:  scottw1 at alltel.net
>
>
> _______________________________________________
> Filepro-list mailing list
> Filepro-list at lists.celestial.com
> http://mailman.celestial.com/mailman/listinfo/filepro-list



More information about the Filepro-list mailing list