13.1.1 Overall Implementation

When a C/Base program begins, a set of system formats, special characters, and language dependent names (months, days of week) are selected as current values. This format set contains values that conform to the rules and language of the U.S.A. These values are used by the conversion routines for displaying and entering values. This original set of values are stored in a table compiled into each C/Base program.

If desired, an alternate set of formatting information can be selected by setting the shell variable COUNTRY to the name of a different set. This can be the name of another set that is compiled into the tables (see Appendix C, Country Default Formats for a complete list) or alternately, stored externally in the C/Base library resource file, cbasedir/resource/conetic.r. The formatting sets that have been compiled into tables are referred to as internal sets. Formatting sets that are stored in the resource file are called external sets. The only distinction between the two is that external formatting values can be changed; internal values cannot. NOTE: if the U.S.A. formatting set is acceptable, COUNTRY does not need to be set.

The selected formatting set contains system formats that control the conversion of data values for both input and output. In addition, there are special strings and characters defined to adapt the formats to local conventions. These include the currency symbol, the character used to separate groups of digits in large numbers (the thousands separator), and the character used to separate the whole number and fractional parts of real and money values (the decimal separator). Each formatting set also contains the names of months and days of the week (both abbreviations and full spellings).

In addition to the system input/output formats, the application developer can use custom output formats to do special output formatting to handle specific output requirements. For example, the system input/output format for date values may be mm/dd/yy, but the developer might need to have this date displayed on a report as Fri, 1 Aug 1986. This would mean that the date is entered and displayed on a screen as 08/01/86 but could be reported as above.