Examples: Write # statement

Dim fileNum As Integer, empNumber As Integer, I As Integer
Dim fileName As String, empName As String
Dim empLocation As Variant
Dim empSalary As Currency
fileNum% = FreeFile()
fileName$ = "data.txt"
' Write out some employee data.
Open fileName$ For Output As fileNum%
Write #fileNum%, "Joe Smith", 123, "1 Rogers Street", _
Write #fileNum%, "Jane Doe", 456, "Two Cambridge Center", _
Write #fileNum%, "Jack Jones", 789, "Fourth Floor", 0
Close fileNum%
' Read it all back and print it.
Open fileName$ For Input As fileNum%
For I% = 1 To 3
   Input #fileNum%, empName$, empNumber%, empLocation, _
   Print empName$, empNumber%, empLocation, empSalary@
Next I%
Close fileNum%
' Output:
' LotusScript prints out the contents of the file 
' C:\data.txt in groups of four values each. Each group
' consists of a String, an Integer, a Variant, and
' a Currency value, in that order.