Here's another way to do it:

function ConvertTF what
    return abs(5-length(what))
end ConvertTF

Enjoy!

Ken Ray
Sons of Thunder Software
Email: [EMAIL PROTECTED]
Web Site: http://www.sonsothunder.com/

----- Original Message -----
From: "J. Landman Gay" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, April 02, 2002 8:00 PM
Subject: Re: Convert T/F


> Scott Rossi wrote:
> >
> > Can "true" and "false" be converted into their numeric equivalents
(1/0)?
>
> The perfect chance to post one of my favorite handlers. Wish I'd written
it:
>
> function whichOne var,fld1,fld2
> -- from a handler by Tony Root
> -- Handles a case where you need to return one value if your key is
> empty, another if not.
>
>   return (item offset(char 1 of (var = empty),"tf") of quote & fld1
> &","& fld2 & quote)
> end whichOne
>
> You can adapt it to almost anything:
>
> function whichOne var -- pass true or false
>   return (item offset(char 1 of (var="true"),"tf") of "1,0"
> end whichOne
> --
> Jacqueline Landman Gay         |     [EMAIL PROTECTED]
> HyperActive Software           |     http://www.hyperactivesw.com
> _______________________________________________
> metacard mailing list
> [EMAIL PROTECTED]
> http://lists.runrev.com/mailman/listinfo/metacard
>


_______________________________________________
metacard mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/metacard

Reply via email to