[chuck-users] Inner loop array index bug
stefan.blixt at gmail.com
Wed Apr 22 10:18:46 EDT 2009
I think ChucK can get pretty confused about this line:
x[msg.which] => int x;
...in which x is treated both as an array and as a newly declared integer
variable. I would rename the array to avoid confusion.
On Wed, Apr 22, 2009 at 2:04 PM, Hans Aberg <haberg at math.su.se> wrote:
> I encountered what looks like a bug. In the sample code below, the array
> indexing in the line with the assignment of x0 causes the following error:
> [bug597534.ck]:line(22): array subscripts (1) exceeds defined dimension
> It does not happen when the same kind of construct is used in the top loop,
> also as in the example code.
> Hans Aberg
> Hid kb;
> HidMsg msg;
> if(!kb.openKeyboard(0)) me.exit();
> <<< "Keyboard '", kb.name(), "' ready." >>>;
> // Key x-axis coordinate
> int x;
> kb => now;
> x[msg.which] => int y;
> x[msg.which] => int y0;
> x[msg.which] => int x;
> x[msg.which] => int x0;
> chuck-users mailing list
> chuck-users at lists.cs.princeton.edu
Release me, insect, or I will destroy the Cosmos!
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the chuck-users