Problems while trying to create a menu from a data array
Patrick1ab
Posts: 136
Hi everyone,
I tried to build a procedure that creates a menu on my LCD and that can be called by any other part of my program (menu title, data array and some information
about the length / the number of entries and the current cursor position handed over).
It seems though that I made a mistake handing over the data array, because only the first element of the menu is displayed and the rest is corrupted.
Could someone please have a look on the code I wrote?
I also included a small test program, but you will have to make changes according to your input or output devices.
I tried to build a procedure that creates a menu on my LCD and that can be called by any other part of my program (menu title, data array and some information
about the length / the number of entries and the current cursor position handed over).
It seems though that I made a mistake handing over the data array, because only the first element of the menu is displayed and the rest is corrupted.
Could someone please have a look on the code I wrote?
I also included a small test program, but you will have to make changes according to your input or output devices.
Comments
which is not what you think it is. Replace this with
and you'll have your strings displayed. data[noparse]/noparse is a long array starting at the address of the data parameter (which is why data[noparse][[/noparse]0] gives you the correct first string but garbage for the remainder).
Thank you very much for your help, kuroneko.