setProfileStringAppServer

setProfileStringAppServer(fileName: String;
                          section:  String;
                          keyName:  String;
                          string:   String): Boolean;

The setProfileStringAppServer method of the Application class copies a string into the section of an initialization file specified in the section parameter on an application server workstation when the application is running in JADE thin client mode. This method returns true if it succeeds in storing the specified string.

If the application is not running in JADE thin client mode, this method functions like the Application class setProfileString method or process.setProfileString; that is, it copies a string into the section of an initialization file specified in the section parameter on the workstation on which the application is running. To retrieve a stored string, use the getProfileStringAppServer method.

The parameters for the setProfileStringAppServer method are listed in the following table.

Parameter Specifies the …
fileName Initialization file. If you set this parameter to windows, the win.ini file on the client node is used. If this parameter does not contain a full path to the file, Windows searches for the file in the Windows directory on the client node.
section Initialization file section containing the key (parameter) name.
keyName Name of the key (parameter) whose associated string is to be stored.
string String that is to be written to the file.

You can use this method to copy a string to a two-level section name (prefixed with a unique identifier) within a JADE initialization file shared by multiple programs on the same application server host. For details, see "Two-Level Section Names" under "Format of the JADE Initialization File", in the JADE Initialization File Reference. However, you cannot use this method to update JADE initialization file parameter values specified on the command line. Attempts to do so return a value of false and the parameter values are unchanged.

To remove a key parameter (keyName) from an initialization file, set the string parameter to ProfileRemoveKey (a global constant in the JadeProfileString category). To remove an entire section in an initialization file, set the keyName parameter to ProfileRemoveSection (a global constant in the JadeProfileString category).

The following example shows the use of the setProfileStringAppServer method.

begin
    // 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("c:\jade\system\jade.ini",
                                  ".JadeAppServer", "EnableAppRestrictions",
                                  "true");
end;