COMPARE() (was Re: browse keys (@bk))

Kenneth Brody kenbrody at bestweb.net
Tue Jul 20 15:58:45 PDT 2004


Fairlight wrote:
[...]
> 4.5  COMPARE            Compares two values, with case sensitivity.
> 
>       Syntax:
> 
>            xx = COMPARE(expr1,expr2)
> 
> Am I to assume that you cannot simply say:
> 
> If: not compare(aa,ab)  'failure case
> Then: 'do something
> 
> If you can't, then yes it's possible to compare sensitively, but you
> have to use extra lines of processing to do it, assigning a value first,
> then checking it,

Why?  Simply check the return value from compare() on the if line:

    If:  compare(aa,ab) ne "0"

> when technically it could be handled with a few extra
> built-in operators.
> 
> I didn't think you could use a function on an If line in fP in this
> fashion.  If you can, please tell me, because that would be Good News[tm].

Boolean functions, yes.  Arithmetic functions, no.

This is valid:

    If:  LOCKED(lookupname)

This is not:

    If:  MOD(aa,"10")

But this is:

    If:  MOD(aa,"10") ne "0"

-- 
+-------------------------+--------------------+-----------------------------+
| Kenneth J. Brody        | www.hvcomputer.com |                             |
| kenbrody at spamcop.net | www.fptech.com     | #include <std_disclaimer.h> |
+-------------------------+--------------------+-----------------------------+



More information about the Filepro-list mailing list