Use this function to retrieve from cache memory the Boolean value of an INI control group and option.
GetINIBool (Context, Group, Option, Default)
Parameter |
Description |
Context |
(Optional) A name (valid name) associated to a set of INI control groups and options that have been loaded into cache memory. |
Group |
Enter the group name (valid string) which contains the INI option Boolean value to retrieve. |
Option |
Enter the option name (valid string) which contains the INI Boolean value to retrieve. If the control group and option does not contain a Boolean value, the system returns a zero (0). |
Default |
(Optional) Enter the default string value to return from the function instead of the actual control group and option value. |
The system returns one (1) if no error occurs, otherwise a zero (0) is returned.
If you omit the context, the function searches all INI files loaded in memory. If there are multiple control groups and options with the same name, this function returns the first INI control group and option string it finds.
If a context name is present, this function only searches for the control group and option in the set of control groups and options associated with the context name.
Let’s assume that an INI file, TEST1.INI, was loaded with the context name, MVF. The TEST1.INI file contains this control group and option:
< Control >
LogEnabled = Yes
In addition, the FSIUSER.INI file contains this control group and option:
< Control >
LogEnabled = No
Plus, the FSISYS.INI file contains this control group and option:
< Control >
LogEnabled = Yes
Based on this scenario, this table shows and explains several possible results.
Function |
Result |
Explanation |
bool_value = GetINIBool (,"Control", "LogEnabled"); |
The variable bool_value now contains a zero (0). |
The function scanned the loaded INI control groups and options. It found the specified control group and option in the FSIUSER.INI first. The FSIUSER.INI set is searched first, followed by the FSISYS.INI set and then any other loaded sets, in order. |
bool_value = GetINIBool ("MVF", "Control", "LogEnabled"); |
The variable bool_value now contains a one (1). |
The function scans only the control group and option set associated with the context name MVF. |
bool_value = GetINIBool ("MVF", "Control", "LogEnabled", 1); |
The variable bool_value now contains a one (1). If Control and LogEnabled are not found, string_value is set to zero (0). |
The function scans only the control group and option set associated with the context name MVF. |
© Copyright 2017, Oracle and/or its affiliates. All rights reserved. Legal Notices