CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 2002
    Location
    Los Angeles, Ca
    Posts
    238

    repeat characters

    Hi everyone .....
    I need to do this for proper formatting of output to a textfile.

    Lets say I have a project with just 1 textbox. What I need to have occour is to take the Len of text1 and subtract that from 20. Then I need to take that sum and print on the form ...
    "A" then Chr(32) repeating the sum of the above calculation .. then "C"

    So that if Len(text1) = 15 I would get
    A C

    Is it possible to do this ?

    Michael

  2. #2
    Join Date
    Jun 2002
    Location
    Lyman ME - USA | Oneonta NY - USA
    Posts
    399
    yes
    Code:
    if Len(text1.text) <= 20 then form1.print "A" & Space(20-Len(text1.text)) & "C"
    hope it helps

    - nc
    "In a world without walls and barriers, what need is there for windows and gates!" - a mac ad
    "What was the best thing before sliced bread and when did sliced bread go out of existence?" - me
    "Software is like sex, it's better when it's free." - Linus Torvalds <- gotten from Andreas Masur


    Live Penguine! - Tux the linux mascot
    Vivez le penguine!, ¡Viva en penguine!, Lang lebe der Pinguin!, Viva no penguine!, Viva sul penguine!

  3. #3
    Join Date
    Apr 2002
    Location
    Los Angeles, Ca
    Posts
    238

    Talking

    Boogt ....
    Thank-you !!! that will work perfectly. I was trying to get it using a for Next loop, and was going crazy :-)

    Michael

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured