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

NLCONVCUSTDATE

MPE documents

Complete PDF
Table of Contents
Index

Edition 7 E0701 ♥
Edition 7 E0300
Edition 6 E0195

NM and CM callable.

Converts the custom date format from a character string to a numeric value; checks the input string by using the formatting template returned by item 2 of the NLINFO intrinsic, then converts the date to the general date format as returned by the CALENDAR intrinsic.

Syntax



  U16                     CA      I16V          I16V     U16A
  date := NLCONVCUSTDATE (buffer, bufferlength, langnum, error);

Functional Return


date

16-bit unsigned integer (assigned functional return)

Returns the date in the following format:

ValueMeaning
7:9Day of year
0:7Years since 1900

Parameters


buffer

character array(required)

Passes the formatted date to be converted into custom date format. Leading and trailing blanks are ignored.

bufferlength

16-bit signed integer by value (required)

Contains the length of buffer (in bytes).

langnum

16-bit signed integer by value (required)

Contains the language ID number, specifying the custom date format for buffer.

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 date string
4Invalid length
5*NLS internal error
6*NLS internal error
7Separator character in buffer does not match custom date template
8Length of date string > 13 characters (excluding leading and trailing blanks)

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


NOTE: When a byte array is passed the code receives the starting position and the length. There is no way for the code to determine if the length you specifiy is correct. Therefore, an error of 4 (invalid string length) is returned only if the specified buffer length is 0 or a negative number. If the passed array length is greater than zero, but is still incorrect, unpredictable results can occur.

Related Information


Intrinsics NLCONVCLOCK, NLFMTCALENDAR, NLFMTCLOCK, NLFMTCUSTDATE, NLFMTDATE, NLFMTLONGCAL
Manuals Native Language Programmer's Guide




NLCONVCLOCK


NLCONVNUM