Shop OBEX P1 Docs P2 Docs Learn Events
Problems while trying to create a menu from a data array — Parallax Forums

Problems while trying to create a menu from a data array

Patrick1abPatrick1ab Posts: 136
edited 2010-04-26 02:45 in Propeller 1
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.

Comments

  • kuronekokuroneko Posts: 3,623
    edited 2010-04-26 02:03
    Patrick1ab said...
    Could someone please have a look on the code I wrote?
    ATM you use

    text.str(data[noparse][[/noparse](y+x)*entrylength])
    


    which is not what you think it is. Replace this with

    text.str(@byte[noparse][[/noparse]data][noparse][[/noparse](y+x)*entrylength])
    


    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).
  • Patrick1abPatrick1ab Posts: 136
    edited 2010-04-26 02:45
    Great!

    Thank you very much for your help, kuroneko.
Sign In or Register to comment.