Using a variable as a field number

Jay R. Ashworth jra at baylink.com
Mon May 10 12:32:02 PDT 2004


On Mon, May 10, 2004 at 03:43:42PM -0400, Kenneth Brody wrote:
> Keith Hamilton wrote:
> > I'm trying to read a textfile and updating a certain field number from the
> > textfile..  How would I go about using a variable for a field number like
> [...]
> >        Then: lookup ord = EORDER  R=RN -n
> [...]
> >        Then: ord(uo(2)) = uo(3)
> [...]
> > How would I go about making uo(2) a field number so filePro knows what to do
> > with it?
> 
> Alias an array to the "ord" lookup, and use the array:
> 
>     dim a_ord(999):ord[1]
> [...]
>     a_ord[uo(2)] = uo(3)

Indeed, Keith; you'll need to take the indirect route: the argument of
a lookup reference is not an expression; it must be a numeric literal
or a variable name.

Cheers,
-- jra
-- 
Jay R. Ashworth                                                jra at baylink.com
Member of the Technical Staff     Baylink                             RFC 2100
The Suncoast Freenet         The Things I Think
Tampa Bay, Florida        http://baylink.pitas.com             +1 727 647 1274

        "They had engineers in my day, too."  -- Perry Vance Nelson


More information about the Filepro-list mailing list