Announcement

Collapse
No announcement yet.

access data in 4DGL_16bitColours.fnc

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

  • access data in 4DGL_16bitColours.fnc

    I'm conducting a text-on-background comparison for legibility and contrast. Is it possible to access the text and hex data in the 4DGL_16bitColours.fnc file as part of a data block. That way, I can loop through set colors for a text block with a different background color, labeling the text and background colors as I proceed.

    Thanks for any help. I did search the site and web before posting.

    Yours truly,

    BSL

  • #2
    Hello,

    The contents of 4DGL_16bitColours.fnc are all constant that would only be compiled when the keywords are called in your code, these are called preprocessor directives. If you want to call these directly in your program you will have to change them into data blocks for storing them in the FLASH, please note that this will consume program FLASH memory.

    #DATA
    word values 0x0123, 0x4567, 0x89AB, 0xCDEF
    byte hexval "0123456789ABCDEF"
    #END

    #DATA blocks reside in the CODE space and can be bytes or words. Data cannot be changed during run-time (i.e. it is read only). A block of data can be indexed like an array. A block of data is declared with the #DATA and #END directives. Every data entry is declared with a unique name which must be a valid identifier.

    I've also attached a sample program doing what you have describe. I hope this helps.

    Best regards,
    Bern
    Attached Files

    Comment


    • #3
      Thank you. I will try it out. Follow-on question. Is it possible to add two new custom colors to the #CONST block? E.g., ROW 1, containing MY_LT_GRAY 0xDEDB, and ROW 2, containing MY_DK_GRAY 0x7BEF? I ask because my two 16-bit colors are those in 565 format, derived from 0xd9d9d9 and 0x7f7f7f, respectively. Thank you. BSL

      Comment


      • #4
        It does work. I added the two colors per your script syntax. Thank you. BSL

        Comment


        • #5
          Hello,

          Your welcome, if you have more questions you can always reach our forum.

          Best Regards,
          Bern

          Comment

          Working...
          X