Search found 5 matches

by thequickbfox
21 Feb 2012, 04:35
Forum: Mindstorms Software
Topic: Dynamic variable name.. possible?
Replies: 4
Views: 4313

Re: Dynamic variable name.. possible?

Thanks for that.

So do I have to upgrade to the enhanced firmware to get multidimensional array support?
by thequickbfox
21 Feb 2012, 04:07
Forum: Mindstorms Software
Topic: Dynamic variable name.. possible?
Replies: 4
Views: 4313

Dynamic variable name.. possible?

Hi, I'm used to Flash Actionscript2 where you can dynamically refer to a variable. eg. setting a value in an array. c1 = new Array(0,0,0,0,0); x = 1; eval("c"+x)[2] = 5; Is anything like this possible in NXC.? Context: I've written a "Connect 4" game playing robot. The gameboard ...
by thequickbfox
02 Feb 2012, 02:12
Forum: Mindstorms Software
Topic: Newbie Simple NXC code problem with array
Replies: 5
Views: 5527

Re: Newbie Simple NXC code problem with array

Hi,
Yes you are correct on the loop, but it didn't error because I used i = 100; There was some other problem that fixed itself upon restarting everything.
Actually is using i = 100 the correct way to escape the loop?
Thanks
Michael.
by thequickbfox
01 Feb 2012, 03:45
Forum: Mindstorms Software
Topic: Newbie Simple NXC code problem with array
Replies: 5
Views: 5527

Re: Newbie Simple NXC code problem with array

Thanks for that but...there's no problem with the loop. I just re-started everything and re-ran the code and it works. So what I think happened is that the program got confused as I forgot to declare the "myVal" variable initially and from that point it just assumed "myVal" was a...
by thequickbfox
01 Feb 2012, 01:10
Forum: Mindstorms Software
Topic: Newbie Simple NXC code problem with array
Replies: 5
Views: 5527

Newbie Simple NXC code problem with array

Hi, Just started using NXC. Want to make a connect 4 Robot Game (with NXT display). At the moment I can't even get an int value out of the array and test it. Please explain, I get "File error!". the line: "ArrayIndex(myVal,col1,i);" - is the issue as it seems to cause the "i...