I want to read a binary zero out to a flat file and am having problems.
Does anyone have any information on how to approach this?
Thanks.
Binary Zeros
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 81
- Joined: Wed Jul 14, 2004 3:18 am
- Location: Johannesburg, South Africa
- Contact:
OK, good! I really don't do well without specifics. I tried the following:
And it seemed to work fine. The output for zero in binary (ASCII encoding) was 00110000, which is correct (try Alt+048, it'll give you a 0).
Code: Select all
Oconv("0", "MB0C")
Morney le Roux
There are only 10 kinds of people: Those who understand binary and those who don't.
There are only 10 kinds of people: Those who understand binary and those who don't.
Thanks for the help Ogmios/Ketfos.
The reason why I need to write a binary zero to a file is because I was intersted in converting a value to pack decimal. My code will work for any value unless one or more bytes contains a binary zero/null.
So for example the value 6476 packed returns the correct Acii chars dv with 64 the hex value of ascii d and 76 the hex of ascii v but the conversion of the value 4000 grinds to a halt. The '40' byte converts okay to ascii @ but every time I hit a null byte (00 in hex) the process fails.
The reason why I need to write a binary zero to a file is because I was intersted in converting a value to pack decimal. My code will work for any value unless one or more bytes contains a binary zero/null.
So for example the value 6476 packed returns the correct Acii chars dv with 64 the hex value of ascii d and 76 the hex of ascii v but the conversion of the value 4000 grinds to a halt. The '40' byte converts okay to ascii @ but every time I hit a null byte (00 in hex) the process fails.