Connection Information

To perform the requested action, WordPress needs to access your web server. Please enter your FTP credentials to proceed. If you do not remember your credentials, you should contact your web host.

Connection Type

ProfileInt – PB Docs 150 – PowerBuilder Library

ProfileInt – PB Docs 150

ProfileInt PowerScript function

Description

Obtains the integer value of a setting in the profile file
for your application.

Syntax

Argument

Description

filename

A string whose value is the name of the
profile file. If you do not specify a full path, ProfileInt uses
the operating system’s standard file search order to find
the file.

section

A string whose value is the name of a
group of related values in the profile file. In the file, section
names are in square brackets. Do not include the brackets in section. Section is
not case sensitive.

key

A string specifying the setting name
in section whose value you want. The setting
name is followed by an equal sign in the file. Do not include the
equal sign in key. Key is
not case sensitive.

default

An integer value that ProfileInt will
return if filename is not found, if section or key does
not exist in filename, or if the value of key cannot
be converted to an integer.

Return Values

Integer. Returns default if filename is
not found, section is not found in filename,
or key is not found in section,
or the value of key is not an integer. Returns
-1 if an error occurs. If any argument’s value is null, ProfileInt returns null.

Usage

Use ProfileInt or ProfileString to
get configuration settings from a profile file that you have designed
for your application.

You can use SetProfileString to change
values in the profile file to customize your application’s
configuration at runtime. Before you make changes, you can use ProfileInt and ProfileString to
obtain the original settings so you can restore them when the user
exits the application.

ProfileInt, ProfileString,
and SetProfileString can read or write to files
with ANSI or UTF16–LE encoding on Windows systems, and
ANSI or UTF16-BE encoding on UNIX systems.

note.png Windows registry

ProfileInt can also be used to obtain configuration
settings from the Windows system registry. For information on how
to use the system registry, see the discussion of initialization
files and the Windows registry in Application Techniques.

Examples

These examples use a file called PROFILE.INI,
which contains the following:

This statement returns the integer value for the
keyword Maximized in section PB of file PROFILE.INI.
If there were no PB section or no Maximized keyword in the PB section,
it would return 3:

The following statements display a MessageBox if
the integer value for the Class setting in section Security of file C:PROFILE.INI is
less than 10. The default security setting is 6 if the profile file
is not found or does not contain a Class setting:

See Also


Document get from Powerbuilder help
Thank you for watching.
Was this article helpful?
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x