setProfileString

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

The setProfileString method of the Node class copies a parameter (key name) string specified in the section parameter into the section of an initialization file on the application server.

The key name string is set on the specified node, which does not have to be the current node. If you want to set the key name on the current node, use the node environmental object (system variable).

This method returns true if it succeeds in storing the specified string. Conversely, if the value of the section or keyName parameter is null ("") or empty, this method returns false, to indicate that the JADE initialization file has not been updated.

Use the respective ProfileRemoveSection or ProfileRemoveKey global constant in the JadeProfileString category to delete a section or key, rather than passing a null or empty string in the appropriate parameter of this method.

To retrieve a stored string, use the getProfileString method.

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

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

In JADE thin client mode, this method sets the initialization file string in the specified initialization file on the application server.

If the application is not running in JADE thin client mode, this method functions like the Application class setProfileStringAppServer method or process.getProfileString; that is, it sets the specified profile string on the workstation in which the application or process is running.

The following example shows the use of this method to remove an entire [mySection] section and the WindowPos parameter in the [InternalAS.JadeAppServer] section from the JADE initialization file.

begin
    node.setProfileString(node.getIniFileName, "mySection",
                          ProfileRemoveSection, "");
    // If the user has moved the window, reset it to the default values
    node.setProfileString(node.getIniFileName, "JadeAppServer", "WindowPos",
                          ProfileRemoveKey);
end;