Shop OBEX P1 Docs P2 Docs Learn Events
Is it possible to multiple a string in PBasic? — Parallax Forums

Is it possible to multiple a string in PBasic?

jasperdufjasperduf Posts: 2
edited 2011-02-03 21:37 in BASIC Stamp
Is it possible to multiply a string in PBasic? Lets say I have a number, 9, and I wanted to multiply this number with a string "A" so that it will give me "AAAAAAAAA" in the debug screen? If someone could help me out, then it would be a huge boost to my project. thanks in advance...


PS: its my first post :)

Comments

  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2011-02-03 21:37
    Welcome to the forum, jasperduf!

    Yes, you can do what you're asking. If the number is a constant, for example, DEBUG REP "A"\9 will print 9 "A"s.

    If the number is in a variable, you will have to use DEBUG "A" a FOR/NEXT loop to count out the right number of characters.

    -Phil
Sign In or Register to comment.