Difference between revisions of "INI SET()"
From Recital Documentation Wiki
Yvonnemilne (Talk | contribs) |
Yvonnemilne (Talk | contribs) |
||
| Line 1: | Line 1: | ||
| − | { | + | ==Purpose== |
| + | Function to set the value of a key in a specified section of an 'ini' file | ||
| + | |||
| + | |||
| + | ==Syntax== | ||
| + | INI_SET(<expC1>, <expC2>, <expC3>[, <expC4>]) | ||
| + | |||
| + | |||
| + | ==See Also== | ||
| + | [[INI_GET()]], [[INI_GETSECTION()]], [[INI_SETSECTION()]] | ||
| + | |||
| + | |||
| + | ==Description== | ||
| + | The INI_SET() function sets the value of an individual key in a specified section of an 'ini' file. The function returns .T. (true) if the value is set, .F. (false) if not. | ||
| + | |||
| + | |||
| + | {| class="wikitable" | ||
| + | !Parameter||Description | ||
| + | |- | ||
| + | |<expC1>||Name of the section. | ||
| + | |- | ||
| + | |<expC2>||Name of the key. | ||
| + | |- | ||
| + | |<expC3>||Value to be set. | ||
| + | |- | ||
| + | |<expC4>||Name of the ini file. If this optional parameter it not included, the filename defaults to the recital system configuration file, recital.conf. | ||
| + | |} | ||
| + | |||
| + | |||
| + | ==Example== | ||
| + | <code lang="bash"> | ||
| + | # test.ini | ||
| + | # comment lines are preceeded by a '#' | ||
| + | ; or a ';' | ||
| + | # | ||
| + | # "Sections" are enclosed in [ and ] | ||
| + | [global] | ||
| + | ; key/value pairs are contained in the sections and are written like this | ||
| + | key1 = value | ||
| + | key2 = value2 | ||
| + | ; You can include macros in the key/value pairs. | ||
| + | key3 = This is $(key2) and $(key1) | ||
| + | # end of test.ini | ||
| + | </code> | ||
| + | <code lang="recital"> | ||
| + | ini_set('global','key1','new value','test.ini') | ||
| + | </code> | ||
| + | |||
| + | |||
| + | ==Products== | ||
| + | Recital, Recital Server | ||
| + | |||
| + | [[Category:Documentation]] | ||
| + | [[Category:Functions]] | ||
| + | [[Category:INI Files]] | ||
| + | [[Category:INI Files Functions]] | ||
Revision as of 13:47, 3 November 2009
Purpose
Function to set the value of a key in a specified section of an 'ini' file
Syntax
INI_SET(<expC1>, <expC2>, <expC3>[, <expC4>])
See Also
INI_GET(), INI_GETSECTION(), INI_SETSECTION()
Description
The INI_SET() function sets the value of an individual key in a specified section of an 'ini' file. The function returns .T. (true) if the value is set, .F. (false) if not.
| Parameter | Description |
|---|---|
| <expC1> | Name of the section. |
| <expC2> | Name of the key. |
| <expC3> | Value to be set. |
| <expC4> | Name of the ini file. If this optional parameter it not included, the filename defaults to the recital system configuration file, recital.conf. |
Example
# test.ini # comment lines are preceeded by a '#' ; or a ';' # # "Sections" are enclosed in [ and ] [global] ; key/value pairs are contained in the sections and are written like this key1 = value key2 = value2 ; You can include macros in the key/value pairs. key3 = This is $(key2) and $(key1) # end of test.ini
ini_set('global','key1','new value','test.ini')
Products
Recital, Recital Server