@AF

Henry Arredondo hxarredondo at LKQCORP.com
Mon Aug 27 08:39:46 PDT 2012



-----Original Message-----
From: Kenneth Brody [mailto:kenbrody at spamcop.net]
Sent: Wednesday, August 22, 2012 6:57 PM
To: Henry Arredondo
Cc: filepro-list at lists.celestial.com
Subject: Re: @AF

On 8/22/2012 12:02 PM, Henry Arredondo wrote:
[...]
> Sorry, I upgraded the code while discussing this thread, I'm back to
> the original code and looks like this:

Okay, so no "sitting on" or "loop" involved.

> P1)   DF08
> P1)   2CF8
> P1)  NFPG
>
> 1   if:   p1) co "NF"
>   Then:  xx(5)=p1)
> 2   if:
>   Then: show "@"<xx
>
>
> Shows:   DF08.....    I need it to be NFPG
>
> I need to capture on dummy "xx" the actual value of p1) that meet the
> condition? But it's always giving me the first instance of the array.
> Is there a way to force the actual value of position of the array? Do
> I make sense?

Because you are not in an event related to the "P" associated field group, the reference to "p1" on the "then" line will always refer to the first instance.  The reference to "p1" on the "if" part has no effect on the "then" part.

Consider, for example, the case where the "if" were true, but no instance of
p1 were to match, such as:

     If:  p1 co "NF" or a3 co "foo"
   Then:  xx = p1

Or, using your code as-is, what would happen if two instances of p1 were to contain "NF"?

You can alias an array to "p1", and test each instance individually.  Your code can then determine how to handle the case of multiple matches.

     dim p1_array(3):p1

Now, if you were in an event related to the "P" group, such as @WLFp1, then the reference to "p1" would mean "the one I'm entering / just left / 'sitting on'".

--
Kenneth Brody




----------------

Thanks for clarifying!



Please consider the environment before printing


More information about the Filepro-list mailing list