Wish File.ReadBinary

MrKim

Well-Known Member
Licensed User
Longtime User
It would be really nice to have, like File.Readstring but with no interpretation. Just read the binary in to a string variable.
 

MrKim

Well-Known Member
Licensed User
Longtime User
A string variable cannot hold binary data. You can read a binary file to an array of bytes.

Perhaps I am using the wrong term? I would like to use some of the ASCII high bit characters. For testing I cut and pasted them in to code as a string, and set a string variable = to them, then used that variable successfully. File.ReadString and File.GetText Would not read the same text from a file into a variable.

Below works just fine in code But I cannot read this in from a file:
B4X:
Dim Ftxt AsString
Ftxt="001ö®ËTest Fnameö®ËEmployeeLnameö®Ë0ö®Ë0ö®Ë¹Ùé1ö®ËFrankö®ËArmanö®Ë0ö®Ë0ö®Ë¹Ùé100ö®ËLewö®ËHicksö®Ë-1ö®Ë25ö®Ë¹Ùé110ö®ËKimö®ËMosherö®Ë-1ö®Ë35ö®Ë¹Ùé120ö®ËJerryö®ËJonesö®Ë0ö®Ë33ö®Ë¹Ùé128ö®ËANTHONYö®ËEGFEö®Ë0ö®Ë34.31ö®Ë¹Ùé129ö®ËKELLYö®ËIMRMZIö®Ë0ö®Ë26.99ö®Ë¹Ùé130ö®ËJohnö®ËSmithö®Ë0ö®Ë22ö®Ë¹Ùé131ö®ËGARYö®ËARNIPAö®Ë0ö®Ë58.09ö®Ë¹Ùé142ö®ËJIMö®ËEMLEö®Ë-1ö®Ë46.11ö®Ë¹Ùé"

I notice I was able to post this correctly as well, even though it contains high bit ASCII.
 

MrKim

Well-Known Member
Licensed User
Longtime User
Here is the file as requested. Erel thanks for your continued help. You are truly amazing.

Bye the Bye. Just ran across TextReader. Will that do the trick?
 

Attachments

  • PartsAndTimeHighBit.txt
    172.7 KB · Views: 226

MrKim

Well-Known Member
Licensed User
Longtime User
The encoding is whatever windows/VBA uses. I am writing the files myself in Access VBA using standard text and chr for the high bit stuff. I will give it a try, thanks. As an interesting side note, I originally typed the chr with the (X) and when I tried to post I got an internal server error. ;)
 
Top