HPlogo MPE/iX Intrinsics Reference Manual > Chapter 9 Command Definitions (MAIL-PUTJCW)

NLTRANSLATE

MPE documents

Complete PDF
Table of Contents
Index

Edition 7 E0701 ♥
Edition 7 E0300
Edition 6 E0195

NM and CM callable.

Translates a string of characters from EBCDIC-to-ASCII or ASCII-to-EBCDIC using the appropriate native language table.

Syntax



               I16V       CA        CA         I16V
  NLTRANSLATE (transcode, inbuffer, outbuffer, bufferlength,
               I16V     U16A   CA
               langnum, error, transtable);

Parameters


transcode

16-bit signed integer by value (required)

Passes the translation direction:

ValueMeaning
1EBCDIC-to-ASCII translation
2ASCII-to-EBCDIC translation

inbuffer

character array (required)

Passes the string to be translated.

outbuffer

character array (required)

Contains the translated string. The parameters inbuffer and outbuffer can specify the same array.

bufferlength

16-bit signed integer by value (required)

Passes the number of bytes of inbuffer to be translated.

error

16-bit unsigned integer array (required)

Returns two elements: the first element is the error number; the second element is reserved and always returns 0. The possible error number values are:

ValueMeaning
0Successful
1*NLS not installed
2*Specified language not configured
3Invalid transcode specified
4Invalid length parameter
5*NLS internal error
6*NLS internal error

* Does not apply to calls with a langnum equal to 0 (NATIVE3000/XL).

transtable

character array (optional)

Passes a translation table in a 256 byte array. Each byte contains the translation of the byte whose value is its index. This parameter corresponds to itemnums 13 and 14 of the NLINFO intrinsic. If present, the langnum parameter is ignored, and this routine is more efficient.

Operation Notes


This intrinsic performs the same function as CTRANSLATE, using native language tables.

The inbuffer parameter is translated into outbuffer for length of bufferlength, using a translation table, and is determined as follows:
  1. If transtable is present, a translation is made using transtable.

  2. If langnum equals NATIVE3000/XL, a standard ASCII-to-EBCDIC or EBCDIC-to-ASCII translation is made.

  3. The ASCII-to-EBCDIC or EBCDIC-to-ASCII translation table for the language specified is used.

Related Information


Intrinsics NLCOLLATE, NLCOLLATE2, NLFINDSTR, NLJUDGE, NLKEYCOMPARE, NLREPCHAR, NLSCANMOVE, NLSUBSTR, NLSWITCHBUF
Manuals Native Language Programmer's Guide




NLSWITCHBUF


OPENLOG