Results 1 to 3 of 3

Thread: Printing a string of characters

  1. #1

    Thread Starter
    Member JPRoy392's Avatar
    Join Date
    Aug 2000
    Posts
    50
    I am trying to print a long string of characters (100 bytes or more) stored in a database. The problem that I am having is that I want 30 or so characters to print in a certain section on the page.

    Code:
    Printer.Print txtInk1(0).Text;
    If the length of the characters in thetext box is greater than 30, break on the next line. If it is greater than 60, break again....

    This should be easy, but I am tired being that I stayed up late to watch the Yankees. Thank You.
    Jim

    "...head is all empty and I don't care..."

  2. #2
    Hyperactive Member
    Join Date
    Mar 2000
    Location
    Boulder, Colorado, USA
    Posts
    325
    Code:
    Dim i        As Long
    Dim strTemp  As String
    Dim LineSize As Long
    
    LineSize = 30
    
    For i = 1 To Len(txtInk1(0).Text) Step LineSize
       
       strTemp = Mid$(txtInk1(0).Text, i, LineSize)
       Printer.Print strTemp
    
    Next i
    -Shickadance

  3. #3

    Thread Starter
    Member JPRoy392's Avatar
    Join Date
    Aug 2000
    Posts
    50
    Thank You Mr. Shikadance. That work exactly like I wanted it to.
    Jim

    "...head is all empty and I don't care..."

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