Conditional Array Definitions
John Esak
john at valar.com
Sat Nov 27 09:12:29 PST 2004
How funny, the fact that you can't have "conditional' arrays was the topic
all yesterday in FP Room...
It's amazing how something can be out of sight out of mind... and then come
up in two places simultaneously within minutes/hours/days of each other.
My suggestion along these lines for defining arrays is to put them all at
the very top of your table. Then, there is no chance for using them _before_
they are defined. If you need to run to the top of the table, you can always
put a START or a TOP label (or some such) jut below the definition of the
arrays... since the processing does not need to fall through them for them
to be active. Little known and understood is that you can define arrays over
looked-up files *before* you ever do the lookup.... as in the following...
You can also do some interesting integration with associated fields... which
is what our discussion was about, something like:
if:
1 then: dim array[10]:lkupfile(15)
TOP if:
2 then: lookup lkupfile k=ky i=A -nx
if: not lkupfile
3 then: 'end
if: lkupfile(@af) eq "4"
4 then: show "@ I found the 4th associated field instance on this
record..."; end
if: array[lkupfile(@af)] ne "what_I_want"
5 then: 'do something else
... etc.
John Esak
Visit The FP Room www.tinyurl.com/yuag7 24/7
More information about the Filepro-list
mailing list