By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
458,187 Members | 1,659 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 458,187 IT Pros & Developers. It's quick & easy.

PrintLine vs. WriteLine

P: n/a
According the MSDN,...

The Print/PrintLine functions write display-formatted data to a
sequential file.
(http://msdn.microsoft.com/library/de...vastmPrint.asp)

FileOpen(1, "c:\trash.txt", OpenMode.Output) ' Open file for output.
Print(1, "This is a test.") ' Print text to file.
PrintLine(1) ' Print blank line to file.
PrintLine(1, "Zone 1", TAB(), "Zone 2") ' Print in two print zones.
PrintLine(1, "Hello", "World") ' Separate strings with a tab.
PrintLine(1, SPC(5), "5 leading spaces ") ' Print five leading
spaces.
PrintLine(1, TAB(10), "Hello") ' Print word at column 10.

' Assign Boolean, Date, and Error values.
Dim aBool As Boolean
Dim aDate As DateTime
aBool = False
aDate = DateTime.Parse("February 12, 1969")

' Dates and booleans are translated using locale settings of your
system.
PrintLine(1, aBool, " is a Boolean value")
PrintLine(1, aDate, " is a date")
FileClose(1) ' Close file.

The Write/WriteLine functions write data to a sequential file. Data
written with Write is usually read from a file with Input.
(http://msdn.microsoft.com/library/de...vastmWrite.asp)

FileOpen(1, "TESTFILE", OpenMode.Output) ' Open file for output.
Write(1, "This is a test.") ' Print text to file.
WriteLine(1) ' Print blank line to file.
WriteLine(1, "Zone 1", TAB(), "Zone 2") ' Print in two print zones.
WriteLine(1, "Hello", " ", "World") ' Separate strings with space.
WriteLine(1, SPC(5), "5 leading spaces ") ' Print five leading
spaces.
WriteLine(1, TAB(10), "Hello") ' Print word at column 10.

' Assign Boolean, Date, and Error values.
Dim aBool As Boolean
Dim aDate As DateTime
aBool = False
aDate = DateTime.Parse("February 12, 1969")

' Dates and Booleans are translated using locale settings of
' your system.
WriteLine(1, aBool, " is a Boolean value")
WriteLine(1, aDate, " is a date")
FileClose(1) ' Close file.

It seems to me, that the only lines different are the following:

PrintLine(1, "Hello", "World") ' Separate strings with a tab.
WriteLine(1, "Hello", " ", "World") ' Separate strings with space.

I still need to test these to see if there is indeed any difference,
but, in the meantime, is there a reason to use one over the other? Is
that difference documented anywhere?

TIA

Jan 23 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
TenSpeed,

In a natural language there are a lot of synonyms with what you can express
yourself.

Visual Basic becomes in my opinion the first program language who meets
that.

A language has to be old to have those aspects.

Just my opinion.

Cor
Jan 23 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.