I got my SC Card module working without problems.In my setup, I use a 4x20 LCD for a menu. In this menu when I select "SC Card", the following sub should run. And it does first time without any trouble - it shows names of 6 files on my SD Card. But second time it shows names for first 3 files and then get stuck.

When posting code you need to post all of it, so we can spot errors, not just bits of it.If it is too long then cut it down so that it shows just the errors but post something that compiles and runs and shows the error.

do { entry = root.openNextFile(); lcd.setCursor((j*10)+1, i); String ename=entry.name(); files[j][i]=ename; lcd.print(ename.substring(0,ename.indexOf("."))); i = i + 1; if ((i==4)&&(j==0)) {j=1; i=0;} } while ((entry)&&(i+j<5));So yes j could be one and i could be three. That's the idea. It also seems that after the first completion of this loop, the array is filled as intended.The values are now selectable and I can move a cursor around. This code:

if (files[j][i]=="") {i=0; j=0;}... is checking if an item is empty and if so jump's to the first item. Really works as intended, but only first time I run the sub.

So what is wrong.I declare the array inside the sub to make it local. In this way I hope the memory is cleared after getting out of scope. Is this my mistake?Some has mentions that there could be issues with String-objects. But I cant find anything explicit about this. Could such issues play a role here?

in which case you have not declaired the array to be big enough.Array indexes start at zero, but array sizes are just that sizes. Therefore for an array with eight spaces in it you need to declaire it as