Shop OBEX P1 Docs P2 Docs Learn Events
How to pass zero value parameters to the VGA TEXT library object — Parallax Forums

How to pass zero value parameters to the VGA TEXT library object

robotbuilderrobotbuilder Posts: 3
edited 2011-01-10 07:59 in Propeller 1
I am using the VGA TEXT object to display 15 lines of various colours of text on a VGA monitor. When I try to reset the text colour back to value zero for a section of text using text.str (string($C, 0,"text")) or when trying to reset the text position pointer back to a point half way across the top line using text.str (string( $A,16, $B,0)) I get an error message that I cannot pass a value of zero. I have tried using a constant set to zero but get the same messgae. I have also tried using a variable but it says that it is expecting a number, constant or bracket.
Is there an easy way round this or do I need to hack the library module to not use line 0 or colour 0?

Comments

  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2011-01-09 14:34
    Use the out method to send the zero character.

    -Phil
  • robotbuilderrobotbuilder Posts: 3
    edited 2011-01-10 02:38
    Thanks Phil
    I replaced the previous lines with:

    text.out($0A)
    text.out(16)
    text.out($0B)
    text.out(0)
    text.out($0C)
    text.out(0)

    and it works just fine
    Don't know if there is a more compact way of coding this in spin
    Cheers
  • BaggersBaggers Posts: 3,019
    edited 2011-01-10 06:04
    how about this?
    PUB setABC(a,b,c)
      text.out($0a)
      text.out(a)
      text.out($0b)
      text.out(b)
      text.out($0c)
      text.out(c)
    
  • robotbuilderrobotbuilder Posts: 3
    edited 2011-01-10 06:40
    Yes, Baggers that would work OK and give me a nice one line call.
    Cheers
  • BaggersBaggers Posts: 3,019
    edited 2011-01-10 07:59
    no probs robotbuilder, glad to help :D
Sign In or Register to comment.