Subject: | |
From: | |
Reply To: | |
Date: | Tue, 23 Jul 2002 12:32:11 -0500 |
Content-Type: | text/plain |
Parts/Attachments: |
|
|
"Born, Ken" <[log in to unmask]> wrote in message
news:3d3d6fe8$1@skycache-news.fidnet.com...
> I need to populate an ASCII string that I will convert later to an EBCDIC
> string using the CTRANSLATE Intrinsic. The problem is that I need this
> conversion to generate an EBCDIC HEX(26) and HEX(15).
What you need is the ASCII/EBCDIC conversion table, which can be found in
Appendix C of the FCOPY reference manual. From the table, the character
that translates to an EBCDIC hex 26 (octal 46) is an ASCII hex 17 (octal
27); and the character that translates to an EBCDIC hex 15 (octal 25) is an
ASCII hex 85 (octal 205).
Here's a little program to confirm that:
-----cut here-----
#include <stdio.h>
#pragma intrinsic CTRANSLATE
main(void)
{
unsigned char outbuffer[2];
CTRANSLATE(2, "\x17\x85", outbuffer, 2);
/* Following prints 26 15 */
printf("%.2X %.2X\n", outbuffer[0], outbuffer[1]);
}
-----cut here-----
Walter
* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *
|
|
|