Microsoft.VisualBasic.FileOpen woes...

  • Thread starter Thread starter Nigel V Thomas
  • Start date Start date
N

Nigel V Thomas

I'm upgrading VB6 app which uses the OPEN keyword for reading and writing
text files. (OPEN Filename FOR OUTPUT as #FileNumber)
I've successfully converted the BINARY and RANDOM variants but I keep
getting an exception with the OUTPUT and APPEND .NET variants

Can anyone help pls

Nigel
Code below

Dim Bse As Integer
Dim Filename$ = "C:\TEST123.TXT"
Dim A$
A$ = "TEST"
Bse = FreeFile()
FileOpen(Bse%, Filename$, OpenMode.Output)
Microsoft.VisualBasic.FilePut(Bse, A$) <<<Exception thrown here
FileClose(Bse%)
 
Sry folks, brain fade!

must use Print or PrintLine when writing to sequential files.

Note to self: must use BinaryReader

N
 
Back
Top