IO formats
Input/Output (IO) formats, also known as format masks, define how data is displayed to the user and what format a user must follow when entering new values.
Alphanumeric IO Format Characters
| Character | Purpose |
|---|---|
X | Indicates an alphanumeric character. Excludes: "/\^ ~ @ & | -( ) [ ] * ? = + . , ; : ' |
A | Indicates a letter (A-Z, a-z). |
9 | Indicates a digit. The number of digits entered by the end-user must actually match the number of 9s in the mask.For example: if the IO format is 999, the end-user must type in three digits. |
(n) | Indicates that the preceding character is repeated N times. For example A zip code mask with five digits can be written as: 9(5) |
Numeric IO Format Characters
| Character | Purpose |
|---|---|
. | Indicates the decimal point position. The number of 9s following the period defines the precision. (See Note 1) |
, | Indicates the position of a thousands separator (e.g., for currency). (See Note 1) |
/ | Indicates a literal slash character. |
9 | Indicates a digit. Pads with leading zeros (before the decimal) or trailing zeros (after the decimal) to fit the mask. For example: Mask 999 will display the value 2.2 as 002Mask 9.99 will display the value 2.2 as 2.20 |
(n) | Indicates that the preceding character is repeated N times. For example: Mask 9(3) will display the value 2 as 002. |
Z | Indicates a digit, or a blank if the digit does not exist. Allows you to define thousands separators without forcing leading zeros (unlike using 9s).For example: ZZZ,ZZZ,ZZ9.99 will display the value 1000.25 as 1,000.25. |
+ | Using + will display positive numbers with a + sign and negative numbers with a - sign.+ displays the sign for both positive and negative values.- displays the sign only for negative values.For example: Mask: +ZZZ,ZZZ,ZZ9.99 displays the positive value 2222 as +2,222.00.While the negative value: -2222 will be displayed as -2,222.00. |
- | Using - will only add a sign for negative values.For example: Mask: -ZZZ,ZZZ,ZZ9.99 displays the positive value 2222 as 2,222.00.While the negative value: -2222 would be displayed as -2,222.00. |
$ or £ or € | Currency symbol. Can only be used before the decimal point. For example: Mask €999.99 will display the value 2 as €002.00Mask €ZZZ,ZZZ,ZZ9.99 will display the value 2000 as €2,000.00. |
B | Indicates a space character. Can be used before the decimal point. Can be used to add a blank space between symbols and digits such as € and +.For example: Mask €BZZ9.99 will display the value 2 as € 2.00. |
The , and . characters in the mask are placeholders. They will be replaced at runtime by the decimal and thousands separators defined in the regional settings of the operating system.
These settings are read once on application startup. You must restart the Definer or Windows Designer to apply any changes to these settings.
The regional settings for decimal and thousands separators of the operating system can be overridden in the USDI resource files in the \APP subdirectory of the USoft installation directory.
*decGroupSeparator: <value> will change the symbol used to separate groups of three digits (thousands, millions, etc.).
*decFracSeparator: <value> will change the decimal separation character.
For example:
*decGroupSeparator: .
*decFracSeparator: ,
results in:
1.234.567,01
Alternatively they can be set on the command line using:
-xrm "<resouce name>:<value>"
For example:
-xrm "*decFracSeparator:," -xrm "*decGroupSeparator:."
The decFracSeparator and decGroupSeparator resources must be set as a pair, as shown above. Setting only one will result in an error, and defaults will be used.
USoft Developer assumes your RDBMS returns a period (.) as the decimal separator. If this is not the case, you must set the following resource:
*dbDecFracSeparator: <value>
Date IO Format Characters
| Character | Purpose |
|---|---|
CC, or SCC | Current Century ("S" prefixes a BC date with "-") |
YYYY, or SYYYY | Year ("S" prefixes a BC date with "-") |
YYY, YY, or Y | Last 3, 2, or 1 digit(s) of the year |
CCYY | This element does almost the same as YYYY. The difference is that when CCYY is used and only part of the year is given as input the rest of the date is defaulted to the last millennium, century or decade. For example: When using the CCYY IO-Format, in 1999, the input 99 will result in: 1999. When using the YYYY IO-format the result would have been: 0099 Note that this differs from the Oracle-meaning of CC (Current Century). In Oracle, the statement: SELECT TO_CHAR(sysdate,'CC') FROM DUAL will, in 1999, result in: 20The CCYY element cannot be used in combination with one of the following format elements: BC, AD, B.C., A.D., AM, PM, A.M., P.M., SSSSS FM, TH, SP (These format elements are supported on Oracle only). |
RR | (Oracle only.) RR replaces YY. When you specify a date format of DD-MON-RR, upon entering data, Oracle will store the value as either 19YY or 20YY depending on the value entered. If the last two digits of system date are between 0-49 and the specified year you enter is between 0-49, the returned value stored in the database is for the current century. If the specified date is from 50-99, then the return date is the century before the current one. If the last two digits of the system date are from 50-99 and the specified two-digit year is between 0-49, then the return date is the century after the current one, and if the specified date is between 50-99, the return date is for the current century. |
Q | Quarter of the year (possible values: 1-4; January- March is 1) |
MM | Month (possible values: 01-12; January is 01) |
MONTH | Name of the month (padded with blanks to a length of nine characters) |
MON | 3-letter abbreviation of month |
WW | Week of year (possible values: 1-53; the week numbering method depends upon the standard used by the underlying RDBMS. In the case of the commonly used ISO or ANSI standards, week 1 is the first week which includes at least four days in the new year) |
W | Week of month (possible values: 1-5; week 1 includes the first day of the month) |
DDD | Day of year (possible values: 1-366) |
DD | Day of month (possible values: 1-31) |
D | Day of week (possible values: 1-7, where 1 is Monday, 7 is Sunday) |
DAY | Name of day (padded with blanks to a length of nine characters) |
DY | 3-letter abbreviation of day (MON, etc.) |
J | Julian day (number of days since January 1, 4712 BC) |
AM, or: PM | Meridian indicator |
HH, or: HH12 | Hours of day (possible values: 1-12) |
HH24 | Hours of day (possible values: 0-23) |
MI | Minutes (possible values: 0-59) |
SS | Seconds (possible values: 0-59) |
MMM | Milliseconds (possible values: 000-999) |
/ . , . | Specified punctuation is included in the result (see NOTE 1) |
"..." | String to be included in the result |
$$SHORTDATE$$ | See NOTE 2 |
$$LONGDATE$$ | See NOTE 2 |
When using a date input format such as DD-MON-YYYY on Oracle, input with different punctuation than specified is also accepted, e.g. "01.JAN.1999" or "01/JAN/1999".
For DATE fields, instead of specifying a fixed IO format on domain (or Windows Designer) level, you can make the representation format conform to the specification in your operating system environment. This environment usually contains both a short and a long date format.
You can choose between them by specifying $$SHORTDATE$$ or $$LONGDATE$$ as domain IO format.
If you use this IO format, it is also advisable to use the ConvertAlternativeFormat method, or specify an Alternative Input Format, to enable users to enter dates in formats other than the one used for representation. Especially if you use $$LONGDATE$$ which usually includes a spelled week day.
You can adapt the DATE formats in the system environment via the Control Panel/Regional Settings.
Other IO Format Characters
| Character | Purpose |
|---|---|
XML | Indicates that XML documents must be received or returned. |