Shop OBEX P1 Docs P2 Docs Learn Events
Screen formatting with Parallax Serial Terminal — Parallax Forums

Screen formatting with Parallax Serial Terminal

Don MDon M Posts: 1,653
edited 2011-08-19 13:20 in Propeller 1
Lets say I have 2 messages to print on the terminal screen. I would use:

term.str(string("This message 1 here"))
term.str(string("This message 2 there"))

How do I send the "cursor XY" command to PST so that I can have message 1 in a specific location and message 2 in its specific location?

I know that the CRSRXY command to PST is 2 but I can't figure out how to send 2,0,2 (first line 2nd column) for message 1 and 2,4,2 (fifth line 2nd column) for message 2.

I tried: term.tx(2,0,2) and term.str(2,0,2) but they won't compile.

Help!

Thanks.

Don

Edit: I don't want to use the ParallaxSerialTerminal object if I don't have to. I am using FullDuplexSerialPlus object.

Comments

  • Don MDon M Posts: 1,653
    edited 2011-08-19 10:48
    I figured it out-

    term.str(string(2, 1, 5, "Message here"))

    I can enter it prior to the message.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2011-08-19 11:02
    Right. The only catch is that you can't send a zero that way. For that, you will have to use tx.

    -Phil

    Addendum: You can also use the PST object's Position method to do what you want.
  • JonnyMacJonnyMac Posts: 9,208
    edited 2011-08-19 13:20
    I use this method in a lot of my test programs that have PST output:
    pub moveto(x, y)
    
    '' Move cursor for PST
    
      term.tx(GOTOXY)
      term.tx(x)
      term.tx(y)
    

    At the top of my programming template I have the following PST declarations:
    con
    
       #1, HOME, GOTOXY, #8, BKSP, TAB, LF, CLREOL, CLRDN, CR       ' PST formmatting control
      #14, GOTOX, GOTOY, CLS
    

    There are others but these are the commands I routinely use.
Sign In or Register to comment.