Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Converting Binary to ASCII
Message
From
23/06/1999 09:30:10
 
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00232596
Message ID:
00232937
Views:
19
>>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.

Ed, I have a binary file and I know the field lenghts in the record. I have to convert binary fields to ASCII fields in a text file. I would like to read a binary record and convert it to a text ASCII record.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform