On Sep 19, 2009, at 11:27 AM, Alessandro Sabatelli wrote:
> You can use Javascript to roll your own counter:
>
> var _count = 0;
> function (__number Count) main (__boolean Increasing, __boolean Decreasing,
> __boolean isLimited, __boolean wrapLimits, __number Min, __number Max,
> __boolean Reset) {
> var result = new Object();
>
> if (isLimited) {
> if (wrapLimits) {
> if (Increasing) (_count++)%Max;
> if (Decreasing) _count==Min?Max:_count--;
> } else {
> if (Increasing) _count==Max?_count:_count++;
> if (Decreasing) _count==Min?_count:_count--;
> }
> } else {
> if (Increasing) _count++;
> if (Decreasing) _count--;
> }
>
> if (Reset) _count = 0;
>
> result.Count = _count;
> return result;
> }
This looks correct but if wrapLimits is enabled the counter doesn't wrap or
clip, it continues to increment.
"if (Increasing) (_count++)%Max;" should return the remainder of count/max but
instead I just get _count. Is this a bug or a syntax error?
Roger Jones
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Quartzcomposer-dev mailing list ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/quartzcomposer-dev/archive%40mail-archive.com
This email sent to [email protected]