Cultural Awareness
If your application is ever to go international, there are several things that you should be aware of that facilitate that purpose. This section discusses these, and presents guidelines for producing "culture portable" applications.
Country Dependent Information
Thunderbolt is tuned to the Country Code and establishes its system defaults based upon the Country Code. (The Country Code was established when you installed the Operating System.)
Affected are:
The Currency Symbol
The default Date format
The default Time format
The following separators:
Date separator
Time separator
Thousands separator
Decimal separator
List or Argument separator
CURRENCY SYMBOL - Use the @ to specify the currency symbol in format overrides. You will get the local country's currency symbol. Be sure to allow enough space for it in the character count portion of the format override.
Use of the $ in format overrides unconditionally gives you the $ as the cur-
rency symbol. Only currency symbols that appear before the number are supported.
DATE FORMATS - Every where else in this document we tell you that the default date format is MM/DD/YYYY. But that is really true only if the Country Code is USA or Taiwan. The default template adapts to local custom. For example, in Germany the default template is DD.MM.YYYY and in Japan it is YYYY-MM-DD.
TIME FORMAT - The TIMING command always returns the time as HH:MM:SS in 24 hour format in %answer, and the time in local format in %answer2.
DATE and TIME SEPARATORS - The date separator is either a slash, dash, or period; and the time separator is a colon or a period, depending on local custom.
DECIMAL and THOUSANDS SEPARATORS - In the USA, the period is the decimal separator and the comma is the thousands separator. In many other cultures the role of these two are reversed. For example, the number expressed as 1,234.45 in the USA is expressed as 1.234,45 in Norway. Thunderbolt automatically conforms to local custom for the decimal and thousands separator.
LIST SEPARATOR - This is the important one. A list
separator is used to separate:
1) The arguments in SET and CALC functions
2) The X;Y positioning argument in commands that have it
3) Multiple values in FIND and LOOK commands.
In some of our documentation and examples we show a comma as the list separator. This is a direct conflict in all cultures that use a comma as the decimal separator. So this is how to handle it: A SEMICOLON IS UNIVERSALLY RECOGNIZED AS A LIST SEPARATOR. Cultures that use a period as the decimal separator may use either the comma or the semicolon as the list separator, but cultures that use the comma as the decimal separator MUST use the semicolon for the list separator.
Data Definition Statements and Format Overrides
Please note that the use of commas and periods remain as documented in data definition statements and format override declarations.
For example, a data definition statement of n(4.2) describes a six character numeric field with four integer positions and two fractional positions for all cultures.
Another example: a format override declaration of (@,12.2) might produce a value displayed as $1,257.50 in the USA, but the same declaration will produce DM 1.257,50 in Germany.
Guidelines for "Culture Portable" Applications
For all numeric fractional literal constants that appear in your code use scientific notation. For example, 1.23 or 1,23 can be expressed as 123E-2.
Use the semicolon unconditionally as the list separator in CALC and SET functions, multiple FIND and LOOK values, and in XY positioning arguments.
Use the @ sign in format overrides to get the local currency character(s). The $ in format overrides unconditionally gives you the $ as the currency character in all cultures.
Don't use system defaults for the date template. Since date formats vary from one culture to the next, the best bet is to always use the "template" argument to specify the form desired for the date in SET and CALENDAR commands. Then subsequent code that does string manipulation with the date won't have to change.
Developer Controls
Two Number Types in the Same Report
The default format for all numeric input and output use the local custom thousands separator and decimal separator. These two can be reversed temporarily in three ways:
1) An F option on RPR, PRINT, or REPORT commands cause the role
of the separators to be reversed for all numeric fields displayed
in the output.
2) An F option on an individual report statement cause the role of the
separators to be reversed for all numeric display controlled by that
statement.
3) An F in a format override causes the role reversal for the single
display that the format override controls. Thus, it is possible to
have two numbers side-by-side, one in European format and the
other in USA format.
Alternate Number Types in Import/Export files
Numeric data in outside files is assumed to follow local custom for the thousands and decimal separators. When that is not the case, you can reverse the role of these separators for import/export of any field by including an F in the field specification in the Record Description that describes the file. For example:
PRICE x(f10.2)
Note that .DBF files store numeric data with a period as the decimal separator. Thus, if your culture uses a comma as the decimal separator, your record descriptions for importing and/or exporting .DBF files should use the F specifier.
To more firmly place control of country dependent information in your hands, see the description of MODE COUNTRY
. With MODE COUNTRY you can establish your own country dependent parameters. Since this is explicit, it takes precedence over any other means of establishing country dependent parameters.
Copyright © 2019 , WhamTech, Inc. All rights reserved. This
document is provided for information purposes only and the contents hereof are
subject to change without notice. Names may be
trademarks of their respective owners.