VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



This is a simple routine to print a long text string splitting it in short text lines starting in

by Raul Lopez (4 Submissions)
Category: String Manipulation
Compatability: Visual Basic 4.0 (32-bit)
Difficulty: Unknown Difficulty
Originally Published: Sun 19th September 1999
Date Added: Mon 8th February 2021
Rating: (1 Votes)

This is a simple routine to print a long text string splitting it in short text lines starting in "X" position. It is useful when you have a

Rate This is a simple routine to print a long text string splitting it in short text lines starting in



'text lines starting in "X" position
'
'It is useful when you have a multi-line text box and need to print
'it's content within a limited area on a paper form.
'
'The easyest way is looking for line advance character [Chr(10)] but
'you can use any character you wish.

'Public declarations
  Dim LongText as String, ShortLine as String

  Public Sub PrintLongText(LongText As String)
     Do While InStr(1, LongText, Chr(10), 0)
        Pos = InStr(1, LongText, Chr(10), 0)
        ShortLine = Left(LongText, Pos)
        LongText = Right(LongText, Len(LongText) - Pos)
        Printer.Print Tab(X); ShortLine;
     Loop
     Printer.Print Tab(X); LongText
  End Sub

'Call the routine
  PrintLongText TexBox.text

Download this snippet    Add to My Saved Code

This is a simple routine to print a long text string splitting it in short text lines starting in Comments

No comments have been posted about This is a simple routine to print a long text string splitting it in short text lines starting in . Why not be the first to post a comment about This is a simple routine to print a long text string splitting it in short text lines starting in .

Post your comment

Subject:
Message:
0/1000 characters