General Category > Ongoing Anim8or Development
ASL integer bit-wise operators
Steve:
Bumping topic so it's apparent that I updated it.
Raxx:
I tested --/++ a bit, looking good. There is an issue with the C-like for loop though, incrementing/decrementing (like in the code below) doesn't work.
--- Code: ---#command("object");
int $i;
file $c;
$c.open("$console", "w");
for ($i = 10; $i > 0; $i--)
{
$c.print("%d\n", $i);
}
$c.close();
--- End code ---
I notice that these are only post-decrement/increment operators, not pre-decrement/increment. I rarely use pre-, so I don't really care, but figured it's worth pointing out.
By the way, having alt toggle arc rotate is like a sweet breath of fresh air :) Many thanks!
Steve:
Hmmm. Pre increment and decrement should be there as well. I only have a couple of test cases (test cases are as much work as the original code !!!) so can you send me yours that don't work correctly?
Raxx:
Here's a few.
--- Code: ---#command("object");
int $i;
file $c;
$i = 2;
$c.open("$console", "w");
$c.print("%d\n", $i);
$c.print("%d\n", (++$i)); // Fine in parenthesis
$c.print("%d\n", ++$i); // Causes Loading Error
$c.print("%d\n", --$i); // Causes Loading Error
++$i; // Causes Loading Error
--$i; // Causes Loading Error
$c.close();
--- End code ---
Steve:
Ahhh, foiled by the old Leading Unary Operator trick!
All my tests are of the form "$x = ++$y" so I can see the value of the expression as well as the underlying variable. Anim8or doesn't currently (and apparently never did!) accept expression statements that begin with any unary operator, such as:
-$i;
I'll fix this and have an update shortly.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version