Shop OBEX P1 Docs P2 Docs Learn Events
Could some one please tell me why this scrolling text box doesnt work? — Parallax Forums

Could some one please tell me why this scrolling text box doesnt work?

Kaos KiddKaos Kidd Posts: 614
edited 2006-05-23 20:02 in Propeller 1
I'v tried everything I can think of, and I just can't see why the textbox doesnt scroll or work right when the text is less then the size of the box...



▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Just tossing my two bits worth into the bit bucket


KK

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2006-05-20 19:47
    Correct me if I'm wrong, but isn't this
    VGA.STR(Text[noparse][[/noparse]Index])
    supposed to be
    VGA.STR(@Text[noparse][[/noparse]Index])
    ?
    Also shouldn't
    HoldChar := Text[noparse][[/noparse]Index + Size + 1]
    be
    HoldChar := Text[noparse][[/noparse]Index + Size]
    ?
  • Kaos KiddKaos Kidd Posts: 614
    edited 2006-05-21 15:04
    Hmmmm...
    I had not thought of that... thanks for the insight and I'll give it whirl!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Just tossing my two bits worth into the bit bucket


    KK
    ·
  • Kaos KiddKaos Kidd Posts: 614
    edited 2006-05-22 02:15
    Well, that wasn't it...
    It's printing trash...
    I changed the ref's to include @Text[noparse][[/noparse]Index]
    I think it's got something to do with what is acutally created with STRING command, or what VGA.OUT is expecting

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Just tossing my two bits worth into the bit bucket


    KK
    ·
  • Mike GreenMike Green Posts: 23,101
    edited 2006-05-22 02:24
    VGA.OUT expects a character value. VGA.STR expects the address of a null-terminated string. STRING constructs a null-terminated string constant and its value is the address of the string at run-time.
  • Kaos KiddKaos Kidd Posts: 614
    edited 2006-05-22 15:24
    Mike:
    As I figured out. Hence the VGA.STR call, now follow this: If I remove the [noparse]/noparse from the call, it prints!
    Yes, if I do VGA.STR(@Text), it prints it all out.
    But, if I do VGA.STR(@Text[noparse][[/noparse]Index]), I get "trash" on the screen.
    I understand about the null terminator, that's how I'm setting the length of the string to print.
    HoldChar = the original char, then I set it to null, print it, then reset it.
    The question is simply this: Why can't I start outputing from the middle of the screen?
    Eventually this routine will be included in something that gets its data from a device (like the directory of a SD device or something), which may or may not be be bigger then the scrolling window.
    Oh, and BTW, thanks for helpin me out here...

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Just tossing my two bits worth into the bit bucket


    KK
    ·
  • Beau SchwabeBeau Schwabe Posts: 6,568
    edited 2006-05-23 00:04
    Kaos Kidd,

    I modified your code a little bit, I believe this version is closer to what you are looking for.



    Version 1:   - Initial scrolling solution of modified code
    
    Version 2:   - Added automatic character padding on either side of main scrolling text
                 - "Title" or non scrolling text can be a null string size.
                 - The main scrolling text can range from 1 character to 255 characters.
                   In other words it can be smaller than the available scrolling window and
                   still scroll from right to left.
    
    

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.

    Post Edited (Beau Schwabe (Parallax)) : 5/23/2006 7:19:20 PM GMT
  • Kaos KiddKaos Kidd Posts: 614
    edited 2006-05-23 03:21
    Beau:
    Thanks! I would have never thought of the byte command.
    Slick..
    THanks again all!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Just tossing my two bits worth into the bit bucket


    KK
    ·
  • Kaos KiddKaos Kidd Posts: 614
    edited 2006-05-23 20:02
    Beau:
    THe new edits are much better... and slicker!
    thanks again...

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Just tossing my two bits worth into the bit bucket


    KK
    ·
Sign In or Register to comment.