Announcement

Collapse
No announcement yet.

How to update a string.

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to update a string.

    I added a string object and am trying to figure out how to programmatically change the string:

    When I paste the code, I get this:

    Code:
    media_SetSector(0, Strings1FontStartL) ;    // must come b4 setting fontID
    txt_FontID(MEDIA) ; // Font index correct at time of code generation
    txt_FGcolour(WHITE) ;
    txt_BGcolour(BLACK) ;
    gfx_MoveTo(4 , 2) ;
    PrintDisk(Strings1StartH, Strings1StartL, Strings1Size, i) ; // where i is Message 0 - Strings1Count-1
    I can't find PrintDisk in the Goldelox internal function document. Anyway, I would like to be able to change the string from a serial input, but am not sure which internal function to use to update the string contents. I can't print from a known set of strings (at compile time), as the user has the option to set this value.

  • #2
    I figured this out. There appears to be a bug in the IDE, as the pasted code PrintDisk line does not compile for Goldelox.
    Instead, you can just use the print command after using media_SetSector(0, Strings1FontStartL).

    Comment


    • #3
      Hello,

      Welcome to the forum,

      In the code example, PrintDisk is a library function so further up in the example there should have been a line #inherit "PRINTDISK.inc" there is also a goldelox version #inherit "PRINTDISKGOLDELOX.inc"

      I hope this helps

      Best regards

      Paul

      Comment

      Working...
      X