4D v15

English-US settings in Method editor

Home

 
4D v15
English-US settings in Method editor

English-US settings in Method editor  


 

 

Starting with 4D v15, 4D's Method editor uses the international "English-US" language by default, regardless of the 4D version or local system settings. This new feature neutralizes any regional variations that might disrupt code interpretation between 4D applications (date formats for instance); and in French versions of 4D, commands and constants are now written in "English-US" as is already the case in other languages. 

This new default setting provides 4D developers with two main advantages:

  • It facilitates code sharing between developers, regardless of their country, regional settings, or the 4D version used. A 4D method can now be exchanged by simple copy/paste, or saved in a text file, with no compatibility issues.
  • It also makes it possible to include 4D methods in source control tools, which often require exports to be independent from regional settings and languages.

You can disable this setting by means of a new option in the 4D Preferences dialog box.

The new Use regional system settings option allows you to disable/enable the "international" code settings for the local 4D application. This option is found in the 4D Preferences dialog box, on the Methods/Options tab:

When this option is unchecked (default in 4D v15), English-US settings are used in 4D methods. If this option is checked, regional settings are used in 4D methods, as in previous 4D versions.

If you modify this option, you need to restart the 4D application so that the change is taken into account. 

The new English-US settings may have several effects on the way you write methods. This concerns code written in development mode as well as formulas in deployed applications.

In this new mode, code must comply with following rules:

  • Decimal separators for real numbers must now be periods (".") in all versions (and not commas (",") as is the custom in French, for example).
  • Date constants must now use the ISO format (!YYYY-MM-DD!) in all versions.
  • Command and constant names must be in English (this change only concerns French versions of 4D, since this was already the case with other languages).

Note: The Method editor includes specific mechanisms that automatically fix incorrect entries if necessary.

The following table illustrates differences between code in 4D v15 and in previous versions:

Code sample in methods/formulas
4D v15 (default mode, all versions)a:=12.50
b:=!2013-12-31!
Current date
4D v14 or 4D v15 (preference checked, US version, for instance)a:=12.50
b:=!12/31/2013!
Current date
4D v14 or 4D v15 (preference checked, French version)a:=12,50
b:=!31/12/2013!
Date du jour

Note: In previous versions of 4D, and in 4D v15 when the new preference is checked, real and date formats are based on system settings.

Certain specific changes only concern French versions of 4D, which used to provide French names (for commands and constants) in the language, as well as in the online help and documentation. More information is provided in the French version of this manual.

In applications converted from previous versions, the English-US settings for 4D code in 4D v15 can sometimes require adaptations to be made in the context where code is interpreted on-the-fly and not tokenized, such as with EXECUTE FORMULA. This concerns the 4D development mode and also deployment products (4D in remote mode and merged 4D applications).

The following table lists the impacts in 4D v15 applications, depending on the operating language (other languages should be impacted in the same way as the US version):

FeaturesImpact when 4D application language is USImpact when 4D application language is FRImpact when 4D application language is DE
Apply Formula Editorin formulas: date format onlyin formulas: command language (US) and date/time/dec separatorin formulas: date format + dec separator
Quick Reportin formulas: date format onlyin formulas: command language (US) and date/time/dec separatorin formulas: date format + dec separator
4D Writein formulas: date format onlyin formulas: command language (US) and date/time/dec separatorin formulas: date format + dec separator
4D Viewnonein formulas (when using 4D commands, not 4D View commands): command language (US)none
PROCESS 4D TAGSdate format onlyCommands (if not using :Cxxx) date/time/dec separatordate format + dec separator
EXECUTE FORMULAdate format onlycommand language (US) and date/time/dec separatordate format + dec separator
METHOD GET CODE/METHOD SET CODEdate format onlycommand language (US) and date/time/dec separatordate format + dec separator

Since the Use regional system settings preference is local to the machine, it must be set on each computer where the 4D application is run if you want to use regional settings. In the context of merged applications, you have to edit the 4D v15 preference file on each local machine and set the "use_localized_language" key to "true".

Note: Solutions for using regional settings in deployed applications are provided in the French version of this manual.

 
PROPERTIES 

Product: 4D
Theme: Design Mode

 
HISTORY 

 
ARTICLE USAGE

4D v15 - Upgrade (R-release edition) ( 4D v15)

Parent of : English-US settings in Method editor ( 4D v15)