Shop OBEX P1 Docs P2 Docs Learn Events
STRING("Text",9) : StringAddress Syntax Question — Parallax Forums

STRING("Text",9) : StringAddress Syntax Question

What is the value 9 used for (value can be 1-255)
Regards
Bob (WRD)

Comments

  • evanhevanh Posts: 16,028
    edited 2021-11-05 22:42

    It concatenates a byte, with value of 9, to the end of the byte string. ASCII code 9 is the Tab character. If the 9 was say 32 then it would make a Space character, or 65 would make it a capital A.

    BTW: Single byte UTF-8 is same as ASCII. Intentionally backwards compatible.

  • Thanks
    Bob (WRD)

  • Reminder: If you're going to use the same string from more than one location in a program, you can save space with a DAT table. This definition would give you the same result with the ability to call it from multiple places without redundant definitions.

    dat
    
      s_Msg         byte    "Text", 9, 0
    
    

    Note: My habit is to preface string definitions with "s_" to make clear the @s_Msg is using a pointer to a string.

Sign In or Register to comment.