Supporting Application Class Method Calls and Global Constants

Two-level section name behavior applies to JADE initialization file sections if the section name does not start with a dot character (.) and if the first argument to the Application class:

For details, see "Two-Level Section Names", earlier in this chapter.

If you write JADE code similar to the following, it expects to access the same JADE initialization file that the JADE node is using.

app.getProfileString(app.getIniFileName, "JadeClient", "ServerName", null);

If you share a JADE initialization file among multiple nodes, to ensure that one node will not change values updated by another node, prefix the section names with a dot character (.) to allow accessing of the same section, if required. Conversely, if a user has his or her own JADE initialization file, you can ensure that behavior is not changed, by prefixing sections names with a unique-identifier value.

Calls to the Application class getProfileString, getProfileStringAppServer, setProfileString, or setProfileStringAppServer method obtain values from or set values on the command line if they are present.

The ProfileRemoveKey and ProfileRemoveSection global constants in the JadeProfileString category remove a parameter (key string) or an entire section from a JADE initialization file, as shown in the following example.

begin
    app.setProfileStringAppServer("\Jade\system\jade.ini", "mySection",
                                  ProfileRemoveSection, "");
    // JADE system adds a value of name= (for example, "InternalAS.")
    app.setProfileStringAppServer(app.getIniFileName, "JadeAppServer",
                                  "PictureCacheFile", ProfileRemoveKey);
    // Initialization file name not IDENTICAL, so we can supply a prefix
    // If the user has moved the window, reset it to the default values
    app.setProfileStringAppServer("\jade\system\JADE.ini",
                                  "Test.JadeAppServer", "WindowPos",
                                  ProfileRemoveKey);
    // JADE uses the single-level (top level) section name
    app.setProfileStringAppServer("\Jade\system\Jade.ini",
                                  ".JadeAppServer", "EnableAppRestrictions",
                                  "true");
end;