MPE/iX Intrinsics Reference Manual (32650-90875)

Chapter 9 567
Command Definitions (MAIL-PUTJCW)
NLSWITCHBUF
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
Manual Native Language Programmer's Guide