At 4:20 pm -0800 2/4/02, Scott Rossi wrote:
Can true and false be converted into their numeric equivalents (1/0)?
to which he got a lot of replies showing, that if you try hard
enough, you can make Metatalk just as unreadable as Perl or C.
itemOffset, bitwise operations, abs, referenced
Can true and false be converted into their numeric equivalents
(1/0)?
to which he got a lot of replies showing, that if you try hard enough,
you can make Metatalk just as unreadable as Perl or C.
And I bet Scott was really looking for something else.
To which I respond true.
I assumed
I like this one:
itemoffset(tf,false,true)-1
Although
wordOffset(string,false true)-1
...works better in my situation since I'm dealing with the entire word
and there's no need to initialize matches, etc.
Thanks again.
Regards,
Scott Rossi
Creative Director, Tactile Media
[EMAIL
Can true and false be converted into their numeric equivalents (1/0)?
Regards,
Scott Rossi
Creative Director, Tactile Media
[EMAIL PROTECTED]
http://www.tactilemedia.com
___
metacard mailing list
[EMAIL PROTECTED]
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
]
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
Hey, while we're at it:
on convertTF @tf
put the wholeMatches into saveMatches
set the wholeMatches to true
get (itemOffset(tf, false,true))
if (it 0) then put it into tf
set the wholeMatches to saveMatches
end convertTF
This will actually change the value of the variable
My entry:
function tf bool
return charToNum(char 3 of bool) bitAnd 1
end tf
Dar Scott
___
metacard mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/metacard
On Tuesday, April 2, 2002, at 08:08 PM, Ken Ray wrote:
function ConvertTF what
return abs(5-length(what))
end ConvertTF
I like this!
But why abs()?
If this doesn't need abs(), I think you might have the winning
entry, Ken!
function ConvertTF what
return 5-length(what)
end
/
- Original Message -
From: Dar Scott [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, April 02, 2002 10:24 PM
Subject: Re: Convert T/F
On Tuesday, April 2, 2002, at 08:08 PM, Ken Ray wrote:
function ConvertTF what
return abs(5-length(what))
end ConvertTF
I like
10 matches
Mail list logo