At 15:25 -0600 02/07/2002, [EMAIL PROTECTED] wrote:
>Yeah, I know about float precision, integer(h) and all that, I just don't
>remember strings defaulting to floats when added; I always thought they
>stayed integers?
It appears to be an artifact of implicit type coercion. Try this:
-- Welcome to Director --
h = "5"
put h + 10
-- 15.0000
put value(h) + 10
-- 15
In the first case we're implicitly forcing a string to a number,
which appears to turn it into a float. In the second passing it
through a value filter appears to transmogrify it to an integer.
Dunno if it's always done that or not, since I've always used value
for explicit type coercion. ;)
--
Warren Ockrassa | http://www.nightwares.com/
Director help | Free files | Sample chapters | Freelance | Consulting
Author | Director 8.5 Shockwave Studio: A Beginner's Guide
Published by Osborne/McGraw-Hill
http://www.osborne.com/indexes/beginners_guides.shtml
[To remove yourself from this list, or to change to digest mode, go to
http://www.penworks.com/lingo-l.cgi To post messages to the list, email
[EMAIL PROTECTED] (Problems, email [EMAIL PROTECTED]). Lingo-L is for
learning and helping with programming Lingo. Thanks!]