Question about Multi-Field Indexes
Kenneth Brody
kenbrody at spamcop.net
Wed Sep 1 10:13:22 PDT 2010
On 9/1/2010 10:36 AM, John Esak wrote:
> Yes, the line length of cabe is bothersome. Some get around it with vi, I
> don't do that.
>
> However... You don't have agonize over if-conditions that are too long.
>
> If: very long condition
> then: blah, blah
>
> Can be easily turned into
>
> Line_1 if: half of the condition
> t hen:
> Line_2 if: the other half of the condition
> then:
> if: line_1 and line_2
> then: blah, blah
[...]
You can also refer to a selection set as part of the condition:
if: selection_set_name and state = "NY"
then: blah, blah, blah
You can also use labels for a series of conditions that are almost identical
(I've seen code like this, going on for dozens of lines):
if: (this and that and foo="1") and (something or other or bar="a")
then: ...
if: (this and that and foo="2") and (something or other or bar="b")
then: ...
if: (this and that and foo="3") and (something or other or bar="c")
then: ...
can be simplified to:
part1
if: this and that
then:
part2
if: something or other
then:
if: (part1 and foo="1") and (part2 or bar="a")
then: ...
if: (part1 and foo="2") and (part2 or bar="b")
then: ...
if: (part1 and foo="3") and (part2 or bar="c")
then: ...
In addition to not requiring filePro to re-evaluate the "this and that" and
"something or other" conditions each time, it also eliminates the
possibility of one of the lines having a typo in that part. (You can, of
course, have a typo in the single instance. But hopefully you would catch
that a lot easier than one line in possibly dozens.)
--
Kenneth Brody
More information about the Filepro-list
mailing list