My problem is that
write # appears to embed each record in quotation marks unless I end the command with a semicolon. The issue there is that the record itself contains semicolons.
The
print # takes care of that issue but appears to create an empty record at the end of the file. (i.e. an extra vbCrLf)
The workaround is straight forward
Code:
varRoster = Input(LOF(lngFile), lngFile)
' render records as an array
arrRoster = Split(varRoster, vbCrLf)
' Using Print # command to save file unavoidably
' creates extra vbCrLf at end of file
If Len(arrRoster(UBound(arrRoster))) < 1 Then
ReDim Preserve arrRoster(UBound(arrRoster) - 1)
End If
That works. But I’d prefer an option to avoid this editing entirely if there is one.
(Note: the rest of the application uses arrRoster, so I am not splitting the variant to an array simply for this purpose)