FW: DIM declare/associate against fixed field

Jose Lerebours fpgroups at gmail.com
Tue Feb 1 13:26:12 PST 2022


No, the code did not have any safety net to catch possible issues with 
values set in dummy var ea

I ran a quick test and received an error: index out of range ...

So, I figure that to play it safe, I edited the code where a new dummy 
var defined as ez(2,.0)=mid(ea,"1","2")

then, I checked ez for less than "1" or greater than "12" and set it 
accordingly ...

ran 2nd test with that and no error ...


My guess is that the original programmer may have at one point used a 
number to point to the accounting period
1 through 13 and then changed it to populate dummy variable with the 
actual date instead of the associative number
but did not change the reference of said field further down the code.


On 2/1/22 4:11 PM, rifka via Filepro-list wrote:
> In answer to Jose's inquiry.
>
> -----Original Message-----
> From: rkreiss at verizon.net <rkreiss at verizon.net>
> Sent: Tuesday, February 1, 2022 4:08 PM
> To: 'Jose Lerebours' <fpgroups at gmail.com>
> Subject: RE: DIM declare/associate against fixed field
>
> Jose,
>
> Dim Field(10):11 is 10 fields starting at field 11.  Let's assume that all
> of the fields are (8,mdy/). Then ea should indicate which value in list is
> wanted. Where is ea set?
> Is there a test to see if ea has a value?
> If ea = ""
> Then GOTO.... or set ea =" 01/31/21"
>
> If: list(ea) gt "0" and ea ne ""
> Then: ........
>
> Ea would never be "0" it might be 00/00/00 As it is defined as a date field
> ea could in this case be "01/00/00" but not "0".
>
> Test this out.
>
>
> Richard Kreiss
> GCC Consulting
>
>
>
>
>
> -----Original Message-----
> From: Filepro-list
> <filepro-list-bounces+rkreiss=verizon.net at lists.celestial.com> On Behalf Of
> Jose Lerebours via Filepro-list
> Sent: Tuesday, February 1, 2022 3:43 PM
> To: Filepro 2 List <filepro-list at lists.celestial.com>
> Subject: DIM declare/associate against fixed field
>
> So, looking at some code for a client trying to document their processes and
> help find root cause for some problems they are having and came across this:
>
>
> dim list(10):11
>
>
> then, there is an if like so
>
> if: list(ea) gt "0" :: ...
>
>
> ea is defined as ea(8,mdy/,g) and populated from a table with date set as
> 01/31/2021
>
>
> Fields 11 through 20 are defined as (6,.0)
>
>
> Call me crazy but I thought that one would have to reference the object
> list() by its numeric
> position not by value so, if I wanted to check field 12, I would have to
> check list("2")
>
> What would you expect to be the condition for above IF statement?
>
> NOTE: Posted the question before I even bothered to test it myself ...
>
>
-- 
Jose Lerebours
954-559-7186
https://www.asisuites.com
Accounting - Retail - Wholesale - Distribution
Manufacturing - Warehousing - Transportation - eCommerce - Web Development



More information about the Filepro-list mailing list