HPlogo 900 Series HP 3000 Computer Systems: MPE/iX Intrinsics Reference Manual > Chapter 4 Command Definitions

NLSWITCHBUF

» 

Technical documentation

Complete book in PDF
» Feedback

 » Table of Contents

 » Index

NM and CM callable.

Converts a string of characters from phonetic order to screen order or from screen order to phonetic order.

Syntax

                 I16V     CA       CA

   NLSWITCHBUF(langnum,instring,outstring,

                   I16V    U16V    U16A

               stringlength,left-to-right,error);

Parameters

langnum

16-bit signed integer by value (required)

Contains the language ID number.

instring

character array (required)

Contains the string, in phonetic order, to be converted to screen order.

outstring

character array (required)

Contains the string after conversion. Outstring and instring can reference the address.

stringlength

16-bit signed integer by value (required)

Contains the length, in bytes, of the string to be converted.

left-to-right

16-bit unsigned integer by value (required)

Specifies whether the implied primary mode of the data (if displayed on a terminal) is left-to-right (true) or right-to-left (false), determining which language it is and which strings of characters to switch.

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 installed
3Invalid string length
4Not returned
5*NLS internal error
6*NLS internal error

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

Operation Notes

This intrinsic is designed to handle data for languages written from right-to-left (for example, ARABIC). Screen order is defined right-to-left if the primary mode of the terminal or printer is from right-to-left, as it is when used principally for entering or displaying data from a right-to-left language. Otherwise, screen order is defined to be left-to-right.

NLSWITCHBUF can be used by a program to convert a buffer phonetic order (the order in which the characters is typed at the terminal or spoken by a person) to screen order (the order in which the characters are displayed on a terminal screen or piece of paper). It can also convert data from screen order to phonetic order.

In general, phonetic order and screen order are not the same if USASCII text is mixed with text from a right-to-left language. The relationship between phonetic order and screen order is further complicated by the use of HINDI digits in ARABIC. (HINDI digits play a third role intermediate between ASCII characters and characters of the right-to-left language.)

This intrinsic is designed for a special purpose. Its primary value lies in its application to languages that are written from right-to-left and that may intermix left-to-right text (for example, the use of ENGLISH in ARABIC text).

NLSWITCHBUF can serve the needs of a general program, one not specifically designed for handling right-to-left data. A general program can call NLSWITCHBUF to convert data from phonetic order to screen order and back to phonetic order. One example is an editor that needs to track cursor movement on a terminal against a buffer of text in memory. If the data is not a right-to-left language, then this intrinsic returns the same text (unchanged); for all other languages, phonetic order and screen order are the same.

Related Information

Intrinsics

NLCOLLATE, NLKEYCOMPARE, NLREPCHAR, NLSTRANSLATE, NLSUBSTR

Commands

None

Manuals

Native Language Programmer's Guide (32650-90022)

Feedback to webmaster