no way to compare when less than two revisions
Differences
This shows you the differences between two versions of the page.
Next revision | |||
— | en:docs:fapi:dosgetctryinfo [2018/08/31 02:13] – created prokushev | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | |||
+ | This call obtains country-dependent formatting information that resides in the country information file. | ||
+ | |||
+ | ==Syntax== | ||
+ | | ||
+ | |||
+ | ==Parameters== | ||
+ | ;Length (USHORT) - input : Length, in bytes, of the data area (MemoryBuffer). This length should be at least 38 bytes. | ||
+ | ;Country (PCOUNTRYCODE) - input : Address of the country information structure: | ||
+ | ::country (USHORT) - Country code identifier; 0 is the default country code. | ||
+ | ::codepage (USHORT) - Code page identifier; 0 is the code page of the current process. | ||
+ | ; MemoryBuffer (PCOUNTRYINFO) - output : Address of the buffer where the country-dependent data is returned. The application must request enough space in memory, a minimum of 38 bytes, to hold the returned data. If the requested space is not large enough, the system fills the allocated space with as much data as it can hold. If the requested space is too large, the extra memory requested is set to 0. | ||
+ | |||
+ | The data is returned in the buffer in the following format: | ||
+ | ::country (USHORT) - Country code identifier. | ||
+ | ::codepage (USHORT) - Code page identifier. | ||
+ | :: | ||
+ | |||
+ | Value | ||
+ | Definition 0 | ||
+ | mm/dd/yy 1 | ||
+ | dd/mm/yy 2 | ||
+ | yy/mm/dd currency (CHAR) | ||
+ | Currency identifier, terminated with a null. thousandsep (CHAR) | ||
+ | Thousands separator, terminated with a null. decimalsep (CHAR) | ||
+ | Decimal separator, terminated with a null. datesep (CHAR) | ||
+ | Date separator, terminated with a null. timesep (CHAR) | ||
+ | Time separator, terminated with a null. currencyformat (UCHAR) | ||
+ | The currency bit fields in the following format: | ||
+ | |||
+ | | ||
+ | | ||
+ | 0 = Bits 0 and 1 are used. | ||
+ | 1 = Bits 0 and 1 are ignored; the currency indicator replaces the decimal indicator. | ||
+ | 1 | ||
+ | 0 = No space between the currency indicator and money value. | ||
+ | 1 = One space between the currency indicator and money value. | ||
+ | 0 | ||
+ | 0 = Currency indicator precedes the money value. | ||
+ | 1 = Currency indicator follows the money value. | ||
+ | | ||
+ | Number (in binary) of decimal spaces used to indicate currency value. | ||
+ | | ||
+ | Time format for presentation in file directory: | ||
+ | | ||
+ | | ||
+ | | ||
+ | 1 = 24-hour format. | ||
+ | | ||
+ | | ||
+ | | ||
+ | ; DataLength (PUSHORT) - output : Address of the length, in bytes, of the country dependent information. rc (USHORT) - return | ||
+ | |||
+ | ==Returns== | ||
+ | Return code descriptions are: | ||
+ | * NO_ERROR | ||
+ | * 396 ERROR_NLS_NO_COUNTRY_FILE | ||
+ | * 397 ERROR_NLS_OPEN_FAILED | ||
+ | * 398 ERROR_NO_COUNTRY_OR_CODEPAGE | ||
+ | * 399 ERROR_NLS_TABLE_TRUNCATED | ||
+ | |||
+ | ==Remarks== | ||
+ | The returned country dependent information may be for the default country and current process code page, or for a specific country and code page. For more information on code page, see DosSetCp. | ||
+ | |||
+ | ===Family API Considerations=== | ||
+ | Some options operate differently in DOS mode than in OS/2 mode. Note that not all country information is available in DOS 3.3. | ||
+ | |||
+ | ==C Binding== | ||
+ | <PRE> | ||
+ | typedef struct _COUNTRYCODE { /* ctryc */ | ||
+ | |||
+ | USHORT country; | ||
+ | USHORT codepage; | ||
+ | |||
+ | } COUNTRYCODE; | ||
+ | |||
+ | typedef struct _COUNTRYINFO { /* ctryi */ | ||
+ | |||
+ | USHORT country; | ||
+ | USHORT codepage; | ||
+ | USHORT fsDateFmt; | ||
+ | CHAR | ||
+ | CHAR | ||
+ | CHAR | ||
+ | CHAR | ||
+ | CHAR | ||
+ | UCHAR fsCurrencyFmt; | ||
+ | UCHAR cDecimalPlace; | ||
+ | UCHAR fsTimeFmt; | ||
+ | USHORT abReserved1[2]; | ||
+ | CHAR | ||
+ | USHORT abReserved2[5]; | ||
+ | |||
+ | } COUNTRYINFO; | ||
+ | |||
+ | #define INCL_DOSNLS | ||
+ | |||
+ | USHORT | ||
+ | |||
+ | USHORT | ||
+ | PCOUNTRYCODE | ||
+ | PCOUNTRYINFO | ||
+ | PUSHORT | ||
+ | |||
+ | USHORT | ||
+ | </ | ||
+ | |||
+ | ===Example=== | ||
+ | <PRE> | ||
+ | This example gets country-dependent information. | ||
+ | |||
+ | #define INCL_DOSNLS | ||
+ | |||
+ | #define CURRENT_COUNTRY 0 | ||
+ | #define NLS_CODEPAGE 850 | ||
+ | |||
+ | COUNTRYCODE Country; | ||
+ | COUNTRYINFO CtryBuffer; | ||
+ | USHORT | ||
+ | USHORT | ||
+ | |||
+ | | ||
+ | | ||
+ | |||
+ | rc = DosGetCtryInfo(sizeof(CtryBuffer), | ||
+ | & | ||
+ | & | ||
+ | & | ||
+ | </ | ||
+ | |||
+ | ==MASM Binding== | ||
+ | <PRE> | ||
+ | COUNTRYCODE struc | ||
+ | ctryc_country | ||
+ | ctryc_codepage | ||
+ | COUNTRYCODE ends | ||
+ | |||
+ | COUNTRYINFO struc | ||
+ | ctryi_country | ||
+ | ctryi_codepage | ||
+ | ctryi_fsDateFmt | ||
+ | ctryi_szCurrency | ||
+ | ctryi_szThousandsSeparator db 2 dup (?) ;thousands separator | ||
+ | ctryi_szDecimal | ||
+ | ctryi_szDateSeparator | ||
+ | ctryi_szTimeSeparator | ||
+ | ctryi_fsCurrencyFmt | ||
+ | ctryi_cDecimalPlace | ||
+ | ctryi_fsTimeFmt | ||
+ | ctryi_abReserved1 | ||
+ | ctryi_szDataSeparator | ||
+ | ctryi_abReserved2 | ||
+ | COUNTRYINFO ends | ||
+ | |||
+ | EXTRN DosGetCtryInfo: | ||
+ | INCL_DOSNLS | ||
+ | |||
+ | PUSH | ||
+ | PUSH@ OTHER | ||
+ | PUSH@ OTHER | ||
+ | PUSH@ WORD DataLength | ||
+ | CALL | ||
+ | |||
+ | Returns WORD | ||
+ | </ | ||
+ | |||
+ | ====== Note ====== | ||
+ | |||
+ | Text on based [[http:// | ||
+ | |||
+ | {{page> | ||
+ | |||