setProfileString
setProfileString(fileName: String; section: String; keyName: String; string: String): Boolean;
The setProfileString method of the Process class copies a parameter (key name) string into the specified section of the initialization file of the process.
A method on a specific process instance performs its action on the owning node (that is, a process.
Use the
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
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. |
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 host. For details, see "
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 process.setProfileString(process.getIniFileName, "mySection", ProfileRemoveSection, ""); // If the user has moved the window, reset it to the default values process.setProfileString(process.getIniFileName, "JadeAppServer", "WindowPos", ProfileRemoveKey); end;