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

NLSUBSTR

MPE documents

Complete PDF
Table of Contents
Index

Edition 7 E0701 ♥
Edition 7 E0300
Edition 6 E0195

NM and CM callable.

Extracts movelength bytes from the instring to the outstring.

Syntax



            CA        I16V      CA         I16
  NLSUBSTR (instring, inlength, outstring, outlength,
            I16V           I16V        I16V
            startposition, movelength, langnum,
            I16V   U16A   U16A
            flags, error, charset);

Parameters


instring

character array (required)

Contains the string from which the substring is extracted. The string can contain both 1 byte and 2 byte Asian characters.

inlength

16-bit signed integer by value (required)

Contains the length, in bytes, of instring.

outstring

character array (required)

Indicates where substring is placed.

outlength

16-bit signed integer by reference (required)

Passes the length, in bytes, of outstring. After a successful call, outlength returns the actual length of the substring moved to outstring.

startposition

16-bit signed integer by value (required)

Contains the offset into instring where the substring starts. A value of zero is the beginning point.

movelength

16-bit signed integer by value (required)

Passes the length, in bytes, of the substring.

langnum

16-bit signed integer by value (required)

Contains the language ID number.

flags

16-bit signed integer by value (required)

Contains the flag word, and is used primarily with Asian languages. It is meaningless with 1 byte languages. It is used when special treatment is required:

BitsValueMeaning
12:4Used if the first character of a substring is the second byte of a 2 byte Asian character:
0000Return an error condition
0001Start from startposition +1
0010Start from startposition -1
0011Start from startposition, but replace character with a blank in outstring
0100Start from startposition regardless
8:4Used if the last character in a substring is the first byte of a 2 byte Asian character:
0000Return an error condition
0001Move until movelength +1
0010Move until movelength -1
0011Move until movelength, but replace character with a blank in outstring
0100Move until movelength regardless
0:8Reserved for the operating system

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
3Not returned
4Not returned
5*NLS internal error
6*NLS internal error
7Invalid inlength
8Invalid startposition
9Invalid table element
10Reserved portion of flags not zero
11Invalid value for flags ( 8:4)
12Invalid value for flags (12:4)
13*Start position first byte of an Asian character, or an overflow condition occurred due to flags
14*End position second byte of an Asian character, or an overflow condition occurred due to flags

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

charset

16-bit unsigned integer array (optional)

Contains the character set definition for the language to be used, as returned by itemnum= 12 of NLINFO. When specifying a character set, be sure that the language ID used matches the character set.

Operation Notes


Split-stack calls are not permitted.

Related Information


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




NLSCANMOVE


NLSWITCHBUF