Shop OBEX P1 Docs P2 Docs Learn Events
TV_Text & string variables — Parallax Forums

TV_Text & string variables

SarielSariel Posts: 182
edited 2011-03-30 08:39 in Propeller 1
Maybe I am just missing something, but I cannot get TV_Text to let me use a variable for a text position. I would like to have a variable, Let's call it "V" that steps through lines to be displayed. I am trying something like this line....

text.str(string($A,24,$B,(V),$C,4,"NerpyLine"))

I would like "V" to increment after displaying, so the next time it has to say "NerpyLine" it is on the next line, and not over lapping itself, and do this without a lot of extra code. Is this possible, and if so, How? Is there another Text based TV driver that I can use that would be better suited that I can (hopefully) drop into place with my code, making minimal changes (if any)? I have looked at the Obex, and nothing screams out at me as having the feature I need. I just cannot believe I am the only one that has ever needed this.

Comments

  • Dave HeinDave Hein Posts: 6,347
    edited 2011-03-30 08:23
    You can't put a variable inside of the string directive. You could do the following:
    text.str(string($A,24,$B))
    text.out(V)
    text.str(string($C,4,"NerpyLine"))
    
    Or you could replace the fourth byte in the string with the line address as follows:
    ptr := string($A,24,$B,0,$C,4,"NerpyLine"))
    byte[ptr][3] := V
    text.str(ptr)
    
  • SarielSariel Posts: 182
    edited 2011-03-30 08:39
    Excellent. this is exactly what I am looking for. Thank you very much for the info. Seems to make sense now that you mention it.
Sign In or Register to comment.