variable lookups possible?
John Esak
john at valar.com
Wed Jul 21 06:45:01 PDT 2004
> lookup generic=SOMEVARIABLE i=ANOTHERVAR ...
> <snip>
> --------------------------------------------
> The lookup file name and qualifier can be variable,
> but not the index - at least not without creating a
> processing table that creates another processing
> table.
>
> However, about a year ago I wrote a generic, callable
> processing table that one could call after setting
> three variables (lookup file, qualifier, and index).
> The call table then automatically built the browse.
> Here is a snippet of that code.
>
> :jhbidx eq "A":lookup blk = (jhbfile{"@"{jhbqual{"")
> k=ky i=A -ng b=(brwfmt):
> :jhbidx eq "B":lookup blk = (jhbfile{"@"{jhbqual{"")
> k=ky i=B -ng b=(brwfmt):
Jeff,
Why does this sort of thing have to be done in a CALL that builds
processing, etc. (At least that sounds like what you are saying...) I do
this exact same code all the time inside a regular processing tabel, no
CALL, no building of another table, etc. Set an index_variable, run that
version of the lookup, exactly as you have shown it here. It is a bit
cumbersome, agreed, but until the index becomes an expression (if ever, but
seems like no big deal and something that would be useful in a future
release). What is so hard about writing the code in this way? Agreed, it
would take the 36 lines to do.
John
More information about the Filepro-list
mailing list