Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21282

[RESOLVED] Strange Problem Saving File Using As Binary

$
0
0
Here's the code I use to save a file as binary:

Code:

dim s As String

 s = Text1.Text

 Open App.Path & "\" & C_FileName For Binary As #1
 Put #1, , s
 Close #1

Anything not correct with this code?

Here's the strange problem

The last 10 bytes of the data in string s looks like this:

.......n";[]}[]#END

Note: the two character [] pairs are used to mean vbLF codes

After the data has been saved I use a hex editor to view the contents of the saved file

Here's what the data looks like in the hex editor

.....n"[]}[]#END#END#}n";[]#}#}#}>\n";[]#}n"

Look at all the extra characters (in green) that has been added to the file.

What on earth can cause this?

Viewing all articles
Browse latest Browse all 21282


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>