#104 Array of Strings can not be updated

open
NXC (53)
5
2013-01-02
2012-05-04
Anonymous
No

Hi Guys,

Cool software!

but the following piece of code:

string myStrings[];
ArrayInit(myStrings, "1", 4); // set array of strings to a size of 4 (0..3)
myStrings[0] = "please work";
myStrings[1] = "testing";
TextOut(1, LCD_LINE1, myStrings[1]);

Which according to the changelog should work since Version 1.0.1.b25 (example is the same) ..

Doesn't work on the "Next Byte Codes Compiler version 1.2 (1.2.1.r4, built Tue Mar 15 15:56:24 CDT 2011)" for a .nxc file (on OSX).

What is a workaround for this problem?

Cheers,
Davy

Discussion

  • John Hansen

    John Hansen - 2012-05-04

    2-d arrays, which include arrays of strings that are really arrays of byte arrays under the hood, require the enhanced NBC/NXC firmware due to a bug in the REPLACE opcode that LEGO has never fixed in the standard firmware. I strongly suspect that you are running the standard firmware on your NXT.

     
  • Comment has been marked as spam. 
    Undo

    You can see all pending comments posted by this user  here

    Anonymous - 2012-05-04

    yes you are right.. I'm using the standard firmware..

    should have reported that as well...

     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks