Try OpenEdge Now
skip to main content
GUI for .NET Programming
Using .NET Forms with ABL Windows : Configuring common session features : Regional settings: localization
 

Regional settings: localization

ABL and .NET use different mechanisms to determine regional settings, such as numeric and date formats.
ABL, by default, ignores system-wide regional settings for numeric formats (decimal point and digit grouping characters) and date formats (the order of the day, month, and year). Instead, it defaults to American settings, and you must use startup parameters to modify this behavior. So, to use European number and date formats in an ABL session, you must start the AVM using the European Numeric Format (-E) and Date Format (-d) startup parameters. For example:
prowin32 -E -d dmy
.NET, by default, gets its regional settings from the Control Panel. You can also create custom regional settings for the current .NET context by instantiating and setting properties for a System.Globalization.CultureInfo object.
Thus, in order to ensure uniformity between .NET forms and ABL windows, Progress Software Corporation recommends that you start the ABL session with the Use OS Locale (-useOsLocale) startup parameter. This startup parameter tells the AVM to query the current Windows locale in order to determine what characters to use for the decimal point and digit grouping and in which order dates should be displayed. As long as you do not override these settings for forms (as explained in the next paragraph), the formatting of numeric and date values will be consistent between ABL windows and .NET forms in your application. The SESSION:NUMERIC-DECIMAL-POINT, SESSION:NUMERIC-SEPARATOR, and SESSION:DATE-FORMAT attributes will return the current regional settings.
If you choose to override the system regional settings (by using the -E and -d startup parameters or the corresponding SESSION handle attributes), you must propagate the settings to any .NET forms the application creates by instantiating a System.Globalization.CultureInfo object and setting its properties appropriately.