This content has been marked as final. Show 7 replies
try setting the scriptExecutionStyle to 9, eg.
the scriptExecutionStyle = 9
set it back to 10 when you want to use MX2004 syntax/code.
"And if the [var] was greater than 0, it would [do something], and if 0
or lower, it wouldn't. Now, it seems that values below 0 have the same
effect as values above 0. "
Hasn't it always been this way?
0 is false, every other integer is evaluates to true, even negative
> try setting the scriptExecutionStyle to 9, eg.
> the scriptExecutionStyle = 9
> set it back to 10 when you want to use MX2004 syntax/code.
Yeah, unfortunately, I've got other scripts in the same movie that depend on
it being style 10, so that's not an option.
I mean, it's an easy fix, once I track down all the places that need it, I'm
just rather miffed that they changed this, and I kind of wonder what their
reason for doing so was? I mean, most other languages interpret negative
values as FALSE in boolean statements, and so did Lingo up until the latest
version. I just don't understand why they felt the need to buck the trend
and change that basic rule...
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
8.5 evaluates negative numbers as TRUE. I confirmed this by creating the
on testTruthValue whichValue
if whichValue then
and then testing it in the message window
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?
I just tested Dir MX (v9) and it also evaluates any non-zero number as
true... positive or negative. It is doing a boolean operation of
zero=false and anything else is true
TTBOMM, anything non-zero evaluates to TRUE and has done since D5.
Things get messy when involving VOID in a boolean comparison, but that
too is operator error and why the function voidP() exists
>I just tested Dir MX (v9) and it also evaluates any non-zero number as
>true... positive or negative. It is doing a boolean operation of
>zero=false and anything else is true
Hmm... This is odd, because I know for a fact that the code I'm using
worked perfectly in MX, but doesn't in 2004 unless I add the >0. Now,
running simple tests without all the other stuff going on I get the same
results as you guys. Unfortunately, my actual code is far more complicated,
so there's any number of other things that could be happening differently, I
suppose. Can't think of what other difference would, say, prevent the
numbers from going negative in the first place? Because that's the only
difference between these two versions of my code. It'd be far too much code
to post here searching for the causes of this.
At any rate, negative numbers evaluating as false IS the standard in most
programming languages, but then I guess Macromedia has never been one to bow
to the industry standard for anything... (*grumbles something about
Ctrl-arrow-keys flipping between scripts instead of jumping from word to
word like every other program in existence, random functions starting at 1
instead of 0, etc...*) We'll see if Adobe straightens them out on some of
these issues, assuming they ever do release another Director version...