version 11
GET SYSTEM FORMAT (format; value)
Parameter | Type | Description | |
format | Longint | System format to be retrieved | |
value | String | Value of format defined in the system |
Description
The GET SYSTEM FORMAT command returns the current value of several regional parameters defined in the operating system. This command can be used to build "automatic" custom formats based on the system preferences.
In the format parameter, pass the type of parameter whose value you want to know. The result is returned directly by the system in the value parameter as a character string. In format, you must pass one of the following constants of the "System format" theme. Below is a description of these constants:
Constant (value) | Value(s) returned |
Decimal separator (0) | Decimal separator (e.g.: ".") |
Thousand separator (1) | Thousand separator (e.g.: ",") |
Currency symbol (2) | Currency symbol (e.g.: "$") |
System time short pattern (3) | Corresponding time display format in the form |
System time medium pattern (4) | "HH:MM:SS" |
System time long pattern (5) | |
System date short pattern (6) | Corresponding date display format in the form |
System date medium pattern (7) | "dddd d MMMM yyyy" |
System date long pattern (8) | |
Date separator (13) | Separator used in date formats (e.g.: "/") |
Time separator (14) | Separator used in time formats (e.g.: ":") |
Short date day position (15) | Position of the day, month, and year in the short date format: |
Short date month position (16) | "1" = left |
Short date year position (17) | "2" = middle |
"3" = right | |
System time AM label (18) | Additional label for a time before noon in 12-hour formats |
(e.g.: "Morning") | |
System time PM label (19) | Additional label for a time after noon in 12-hour formats |
(e.g.: "Afternoon") |
Example
On a check that is filled in mechanically, the amounts written are generally prefixed by "*" characters in order to prevent fraud. If the standard system display format for currency is "$ 5,422.33", the format for checks should be of the type "$***5432.33": no comma after the thousand digit and no space between the $ symbol and the first number. The format to be used with the String function must be "$*******.**". To build it via programming, it is necessary to know the currency symbol and the decimal separator:
GET SYSTEM FORMAT(Currency symbol;$vCurrSymb) GET SYSTEM FORMAT(Decimal separator;$vDecSep) $MyFormat:="###"+$vCurrSymb+"*******"+$vDecSep+"**" $Result:=String(amount;$MyFormat)
See Also