Convert T/F
Ken Ray
kray at sonsothunder.com
Tue Apr 2 22:13:01 EST 2002
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: kray at sonsothunder.com
Web Site: http://www.sonsothunder.com/
----- Original Message -----
From: "J. Landman Gay" <jacque at hyperactivesw.com>
To: <metacard at lists.runrev.com>
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 | jacque at hyperactivesw.com
> HyperActive Software | http://www.hyperactivesw.com
> _______________________________________________
> metacard mailing list
> metacard at lists.runrev.com
> http://lists.runrev.com/mailman/listinfo/metacard
>
More information about the metacard
mailing list