Examples: Print # statement

Dim nVar As Variant, eVar As Variant
nVar = NULL
Dim fileNum As Integer
fileNum% = FreeFile()
Open "printext.txt" For Output As fileNum%
' Print two lines to the file and close it.
' First line: two String values, with no separation between.
Print #fileNum%, "First line, " ; "with two String items"
' Second line: NULL value, EMPTY value, Integer variable
' value, and String value, separated on the line by tabs.
Print #fileNum%, nVar, eVar, fileNum%, "at next tab"
Close fileNum%
' Open the file, print it, and close the file.
Dim text As String
Open "printext.txt" For Input As fileNum%
Do Until EOF(fileNum%)
   ' Read and print to console, one line at a time.
   Line Input #fileNum%, text$
   Print text$
Loop
Close fileNum%
' Output:
' First line, with two String items
' NULL                      1            at next tab