Microsoft.VisualBasic.FileOpen woes...

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%)
 
N

Nigel V Thomas

Sry folks, brain fade!

must use Print or PrintLine when writing to sequential files.

Note to self: must use BinaryReader

N
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top