variables for import fields

Ryan Powers ryanx at indy.rr.com
Thu Sep 20 11:17:16 PDT 2012


If I'm following you correctly, then this would work?

MERGEVAL(myimport,600);
lkup(7) = MERGEVAL(myimport, ct);

I rather doubt that the following would work (being nested), but will give
it a try if you think it might.

lkup(MERGEVAL(metadata,1)) = MERGEVAL(myimport,ct)


- Ryan


> -----Original Message-----
> From: Kenneth Brody [mailto:kenbrody at spamcop.net]
> Sent: Thursday, September 20, 2012 1:25 PM
> To: Ryan Powers
> Cc: filepro-list at lists.celestial.com
> Subject: Re: variables for import fiellds
> 
> On 9/20/2012 1:51 AM, Ryan Powers wrote:
> > I'm trying to do an import of a csv file which may vary in the number
> of
> > fields it contains and their order.
> [...]
> > ct(4,.0)="1"
> > fd = metadata(1)
> > lkup(fd) = myimport(ct); ct=ct+"1";
> >
> > The problem is that myimport(ct) fails the syntax check. Is there a
> function
> > that I could use?
> 
> There is an un(der)documented function in 5.7 -- MERGEVAL():
> 
> > One of the not-yet-fully-documented 5.7 features is a new MERGEVAL()
> function,
> > which works similar to FIELDVAL(), except for imports rather than
> lookups.
> >
> >     result = MERGEVAL( importname, fieldnum )
> >
> > There are some limitations on how it works, due to the way the
> filePro runtime
> > engine handles imports.
> >
> > As currently implemented, there needs to be a reference, somewhere in
> the
> > current processing table, to a hard-coded "importname(nn)", where
> "nn" is the
> > highest field number you can access.  (The reference need not
> actually be
> > executed.)  Any reference to a higher number with MERGEVAL() will
> return a null
> > string.
> >
> > There is currently no equivalent to NUMFIELD() to determine how many
> fields
> > were imported for this particular import record.  (Remember, the
> number of
> > fields in an import record is not necessarily fixed.)  You can,
> however, use
> > MERGEVAL(importname,"0") to determine the highest field number
> available, as
> > determined by the "importname(nn)" reference noted above.  This does
> not mean
> > that the current import record necessarily had that many fields
> available.  If
> > you refer to a field which wasn't available on this import record, a
> blank
> > value is returned, just as would result with "importname(xx)"
> >
> > There is currently no corresponding function for EXPORT.
> 
> 
> --
> Kenneth Brody



More information about the Filepro-list mailing list