Shop OBEX P1 Docs P2 Docs Learn Events
Put CR and LF in a string — Parallax Forums

Put CR and LF in a string

JonTitusJonTitus Posts: 193
edited 2021-09-12 21:03 in Propeller 1

I don't know how my post disappeared, but it asked how to include a carriage-return and a line-feed in a string.

Comments

  • JonnyMacJonnyMac Posts: 9,102
    edited 2021-09-12 19:50

    Inline:

      term.str(string("Jon Titus", $0D, $0A))
    

    To be called from multiple places, best to define it in a DAT section.

    dat
    
      Jon           byte    "Jon Titus", $0D, $0A, $00
    
      term.str(@Jon)
    

    Note that you have to manually add the 0-terminator in a DAT section (string() inserts this).

Sign In or Register to comment.