:) Hello,
I am writing a note program, and it saves the note contents into a file.
I use these 2 subs (ECString to convert the string to hex string and DCString to convert it back into a human readable string).
It goes wrong when I use a newline character, because it then puts 2 Ú characters (ascii #218).
Now I know I'm doing something wrong here, but I don't know what...?
I am writing a note program, and it saves the note contents into a file.
I use these 2 subs (ECString to convert the string to hex string and DCString to convert it back into a human readable string).
Code:
Private Function ECString(Expression As String) As String
Dim endstring As String
For i = 1 To Len(Expression)
endstring = endstring & Hex(Asc(Mid(Expression, i, 1)))
Next i
ECString = endstring
End Function
Private Function DCString(Expression As String) As String
Dim endstring As String
For i = 1 To Len(Expression) - 1 Step 2
endstring = endstring & Chr(Val("&H" & Mid(Expression, i, 2)))
Next i
DCString = endstring
End Function
Now I know I'm doing something wrong here, but I don't know what...?