getProfileString

getProfileString(fileName: String;
                 section:  String;
                 keyName:  String;
                 default:  String): String;

The getProfileString method of the Process class retrieves a string from the specified section in an initialization file. (The setProfileString method copies the string into the specified section of an initialization file.)

A method on a specific process instance performs its action on the owning node (that is, a process.node instance) if the process is not associated with a presentation client. If the process has an associated presentation client, the action is performed on the presentation client. The presentation client does not have to be the current presentation client or a presentation client attached to the same application server.

Use the Application class getProfileStringAppServer method or Node class getProfileString method to obtain the file from the application server.

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

Parameter Specifies the …
fileName Initialization file. If you set this parameter to windows, the win.ini file is used. If it does not contain a full path to the file, Windows searches for the file in the Windows directory.
section Initialization file section containing the key (parameter) name.
keyName Name of the key (parameter) whose associated string is to be retrieved.
default Default value for the specified key if the key cannot be found in the initialization file.

You can return all initialization file sections or all parameters in a section, by using the JadeProfileString category global constants listed in the following table.

Global Constant Specified in the… Returns all…
ProfileAllKeys keyName parameter Key (parameter) strings in the initialization file section, separated by spaces
ProfileAllSections section parameter Initialization file sections, separated by spaces

You can use this method to retrieve a string from a two-level section name (prefixed with a unique identifier) within a JADE initialization file shared by multiple programs on the same host. For details, see "Two-Level Section Names" under "Format of the JADE Initialization File", in the JADE Initialization File Reference.

The following example shows the use of the getProfileString method to determine the server for the current JADE initialization file.

vars
    server : String;
begin
    server := process.getProfileString(process.getIniFileName, "JadeClient",
                                       "ServerName", null);
    write "server name is " & server;
end;