Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Converting Binary to ASCII
Message
From
22/06/1999 14:06:31
 
 
To
22/06/1999 13:33:43
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00232596
Message ID:
00232611
Views:
21
>Is there a function or an easy way to convert Binary data to ASCII data?

It depends on what you mean here. Binary data and ASCII data are essentially the same thing - long sequences of 8-bit bytes. ASCII data doesn't contain some specific byte values that aren't represented as printable characters, and typically, an End-Of-File character (CHR(26) in VFP terms) is used to indicate the end of the ASCII text file. Binary data can contain any and all values, and since all values can occur anywhere in the file, no specific character marks the end of file - the operating system or device has to tell you when you've reached the end of the data.

Since binary data can contain non-printing values, some alternate means of representation must be used to make it readable. One of the more common approaches is hexadecimal display representation, which uses two ASCII characters per binary byte, each character value repesenting a hexadecimal digit. For example, a EOF character (CHR(26)) above would be represented as the string 1A: (1 * 16) + A(10). You can use the TRANSFORM function to convert the value of a byte from a binary file (ASC(byte in string)) for output purposes.

If this isn't what you mean, please tell us what the difference is between the binary file that you have and the ASCII representation that is needed.
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform