xx Murphy Law: every constant is not a constant, it change its value over time. :)
Sometimes it's necessary to reference some literals or constants values in the code. For example it's very common to have the name and version of the system in the code, usually to display them in the top or bottom of a webpanel:
Name.Caption = "My Wonderful Application"
Version.Caption = "1.0"
The problem with this code is sometimes these values change, so you need to find where are this constant everywhere in the code. A better approach is to avoid the use of any literal in the code and concentrate all of them in a Domain. If all the parameters have the same type it can be implemented with an Enumerated Domain:
Name.Caption = SystemInfo.Name
Version.Caption = SystemInfo.VersionNumber
Name "My Wonderful Application"
so, in this case, you just need to change the domain in case the constant change.
If the parameters have different types it can be implemented with the following code ( needs GX X Ev1 or above):
SystemInfo based on SystemInfoSDT
Initial Value: InitSystemInfo
InitSystemInfo // Data Provider
Name = "My Wonderful Application"
VersionNumber = '"1.0"
And the code to use it is:
Name.Caption = &SystemInfo.Name
Version.Caption = &SystemInfo.VersionNumber
See also System Parameters.
The can3 constants are:
(I know, it should be named WikiConstants instead of WikiParameters, my fault :( jnj).