Description |
INIPut (Magic xpa 3.x)
Updates an environment value in the Magic.ini file.
|
Syntax:
|
INIPut(inientries,force write)
|
Parameters:
|
inientries: An alpha string containing multiple entries, each indicating a Magic.ini section and parameter, and a value to update '[section]parameter=value'.
force write: Boolean value. In a multi-threaded Magic xpa enterprise server, each runtime context of every thread keeps a separate copy of the Magic.ini file. When this parameter is False, then the new INI modification will only be written into the local Magic.ini copy. In a multi-threaded server, the change will only be reflected for the running thread.
When this parameter is set to True, then the new INI modification will be written into the physical INI. Any new loaded thread will have the new modifications in Magic.ini copy.
|
Returns:
|
True if successful
|
Example:
|
INIPut('Owner=John, Century=1920','FALSE'LOG) sets the current Owner and century value.
|
Note:
|
-
If no Magic.ini section is specified, the [MAGIC_ENV] is used by default. The ini entry parameter is case insensitive. If an entry is not found, a new one is inserted. This function could be used to set Magic xpa specific variables, or to update application dependent global data. If used to update application data, you should ensure that each user has their own Magic.ini file. If you need to share global data and counters among multiple users, you should use standard DB tables. For performance reasons, you may prefer to set the Resident MAGIC.INI setting in the Environment dialog box to 'Yes', in which case the Magic.ini file is updated only when exiting Magic xpa.
-
If the INI file is set to resident, Magic xpa will always regard the value of the force write parameter as FALSE.
-
The Magic.ini file is stored for each Runtime context in a separate memory area. The INIPut function for a specific Runtime context is written to the Magic.ini file only if it is specifically requested by using the following flag: INIPut (<assignment>,<force write>) (default - N)
-
A comma is used to write additional information to the Magic.ini file. Therefore, if you want to use a comma as a value, you should precede the comma with a backslash, like this: \, For example: INIPut('[HELLO_TEST]aa=1\,2','TRUE'LOG)
-
If you want to use a backslash as a value, you should precede the backslash with another backslash, like this: \\ For example: INIPut('[HELLO_TEST]aa=1\\2','TRUE'LOG)
-
You can include an asterisk (*) to instruct Magic xpa to take the entire value until the end, ignoring terminators and quotes. For example: INIPut('[HELLO_TEST]aa=*1\2','TRUE'LOG)
|
See also:
|
INIGet, INIPut Function Behavior
The Online and Rich Client Samples projects (program EV07 and REV07)
|
|
|
---|