Associated fields and @AF

Jay R. Ashworth jra at baylink.com
Sat Jun 25 11:18:43 PDT 2005


On Fri, Jun 24, 2005 at 09:44:08AM -0400, Kenneth Brody wrote:
> Quoting Jay R. Ashworth (Fri, 24 Jun 2005 09:01:08 -0400):
> > On Thu, Jun 23, 2005 at 08:55:12AM -0500, Chad McWilliams wrote:
> > > > I think what you are missing (and perhaps this was not
> > > > mentioned in the manual) is that you need to sort by the
> > > > associated field for this to be effective.
> > >
> > > I'm not trying to disagree with you, but I don't understand what
> > > sorting would have to do with the situation.  All the work is being
> > > done within a single record, so, as I see it, sorting should have no
> > > effect within the individual record.
> >
> > Because @AF *is not set by filepro* unless you sort on the associated
> > field?  :-)  What @AF says is "which of the associated fields in the
> > group is the one responsible for *this* appearance of this record in
> > the temporary output sort file?"  If you don't sort by the associated
> > field, it doesn't fill that it.  I'm surprised it's 1, I'd expect it to
> > be 0... (which would throw an error, and thus be better).
> 
> It is also set in event handlers related to associated fields, such
> as "@WLFA0".

Well, ok; but he was in dreport context, so I didn't assume that
mattered.

At least, I understood he was...

> Basically, you have to be doing something related to associated fields
> in order for @AF to be set.  Simply putting an associated field on an
> "if" line is not enough.
> 
> Also, while in an event related to an associated field, as someone
> alluded to earlier, references to fields in that group will refer
> to the specific instance, and not the entire group.
> 
> For example, in "@WLFA0", references "A0", "A1", "A2" and so on
> will refer to the specific instance of that field based on the
> instance of A0 which you just left.  That makes calculating the
> extension price based on unit price and quantity quite simple, as
> it would be something like "A3 = A1 * A2".

In other words, they act like synchronized arrays.

Which is, admittedly, one of the cooler features of filePro.

Cheers,
-- jra
-- 
Jay R. Ashworth                                                jra at baylink.com
Designer                          Baylink                             RFC 2100
Ashworth & Associates        The Things I Think                        '87 e24
St Petersburg FL USA      http://baylink.pitas.com             +1 727 647 1274

      If you can read this... thank a system administrator.  Or two.  --me


More information about the Filepro-list mailing list