I used an older version of VB (4.0) to create a program and now want to re-create it with VB.net.
A line in my program used the " ; " character to force printing to wrap

I can't do this with VB.net using the 'PrintLine' function. What function allows me to do this or how can I accomplish this?

Thank you for your help.

major_lost

Recommended Answers

All 4 Replies

Is it a console app?
If it is (and you are just building strings), you can just use the ampersand & between strings to concatenate them.

If you are issuing two print statements, you can use Console.Write() instead of Console.WriteLine();
If is is going out to a file (through StreamWriter), you can still call .Write() to output a line with no added linefeed or carriage-return.

Also, you can add vbcrlf or vbnewline to drop to the next line.

ex.

Console.WriteLine("Date: {0}" & vbcrlf & "Time: {1}", Now.Date, Now.TimeOfDay)

This is what I have thus far for code.

        For j = 1 To 625
            I = I + 1

            If MyChar(j) = "" Then
                PrintLine(FileNum, "*")
            Else
                PrintLine(FileNum, MyChar(j))
            End If

            If I = 25 Then
                PrintLine(FileNum, Chr(13))
                I = 0
            Else
                If j = 625 Then Exit For
                PrintLine(FileNum, " ")
            End If

        Next

Sorry for your trouble. I figured it out. I was not aware that "PrintLine" printed each character on
'new' line. I was able to change my code and get it to work the way I wanted.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.