macromedia.director.lingo
[Top] [All Lists]

Re: Difference in boolean ops for MX 2004?

Subject: Re: Difference in boolean ops for MX 2004?
From: Dave C
Date: Thu, 31 Jan 2008 17:37:05 -0500
Newsgroups: macromedia.director.lingo


Pardon me for jumping in your thread, but I am very curious about this. I use the same sort of technique all of the time. I do use an old version of Director (8.5) but hope to upgrade when a new one is released. I don't want to run into any such problems when I import my old code.

8.5 evaluates negative numbers as TRUE. I confirmed this by creating the following handler

on testTruthValue whichValue
  if whichValue then
    return TRUE
  else
    return FALSE
  end if
end


and then testing it in the message window

put testTruthValue(-1)
-- 1

put testTruthValue(0)
-- 0

put testTruthValue(1)
-- 1

You said "most other languages interpret negative values as FALSE in boolean statements, and so did Lingo up until the latest version."

This hasn't been my experience, so what am I missing?

<Prev in Thread] Current Thread [Next in Thread>