For more detailed information, see the Visual Basic topic Print, PrintLine Functions.
The Print and PrintLine functions are provided for backward compatibility and may affect performance. For non-legacy applications, the My.Computer.FileSystem object provides better performance. For more information, see File Access with Visual Basic.
Print does not include a line feed at the end of a line; however, PrintLine does include a line feed.
Data written with Print is usually read from a file by using LineInput or Input.
If you omit Output for PrintLine, a blank line is printed to the file; for Print, nothing is output. Multiple expressions separated with a comma will be aligned on tab boundaries, but mixing commas and TAB may cause inconsistent results.
For Boolean data, either True or False is printed. The True and False keywords are not translated, regardless of the locale.
Date data is written to the file by using the standard short date format recognized by your system. When either the date or the time component is missing or zero, only the part provided is written to the file.
Nothing is written to the file if Output data is empty. However, if Output list data is DBNull, Null is written to the file.
For Error data, the output appears as Error errorcode. The Error keyword is not translated regardless of the locale.
All data written to the file by using Print is internationally aware; that is, the data is correctly formatted using the appropriate decimal separator. If the user wishes to output data for use by multiple locales, Write should be used.
Writing to a file by using the Print or PrintLine functions requires Write access from the FileIOPermissionAccess enumeration. For more information, see FileIOPermissionAccess Enumeration.