Difference between revisions of "INI GETSECTION()"

From Lianjapedia
Jump to: navigation, search
 
(3 intermediate revisions by one other user not shown)
Line 1: Line 1:
 
==Purpose==
 
==Purpose==
 
Function to return all the key/value pairs from a specified section of an 'ini' file
 
Function to return all the key/value pairs from a specified section of an 'ini' file
 
  
 
==Syntax==
 
==Syntax==
 
INI_GETSECTION(<expC1>, <expC2>[, <expL>])  
 
INI_GETSECTION(<expC1>, <expC2>[, <expL>])  
 
  
 
==See Also==
 
==See Also==
 
[[INI_GET()]], [[INI_SET()]], [[INI_SETSECTION()]]
 
[[INI_GET()]], [[INI_SET()]], [[INI_SETSECTION()]]
 
  
 
==Description==
 
==Description==
 
The INI_GETSECTION() function returns all the key/value pairs from a specified section of an 'ini' file.  The value is returned as an object.
 
The INI_GETSECTION() function returns all the key/value pairs from a specified section of an 'ini' file.  The value is returned as an object.
  
 
+
{| class="wikitable" width="100%"
{| class="wikitable"
+
!width="30%"|Parameter||Description
!Parameter||Description
+
 
|-
 
|-
 
|<expC1>||Name of the section.
 
|<expC1>||Name of the section.
Line 22: Line 18:
 
|<expC2>||Name of the ini file.
 
|<expC2>||Name of the ini file.
 
|-
 
|-
|<expL>||.T. to expand macros, .F. to return macros without expanding.  If this optional parameter is not included, macro expansion defaults to .F. (false).
+
|valign="top"|<expL>||.T. to expand macros, .F. to return macros without expanding.  If this optional parameter is not included, macro expansion defaults to .F. (false).
 
|}
 
|}
 
  
 
==Example==
 
==Example==
Line 46: Line 41:
 
This is $(key2) and $(key1)
 
This is $(key2) and $(key1)
 
</code>
 
</code>
 
 
==Products==
 
Lianja, Lianja Server
 
  
 
[[Category:Documentation]]
 
[[Category:Documentation]]
 
[[Category:Functions]]
 
[[Category:Functions]]
[[Category:INI Files]]
+
[[Category:ASCII File Access Functions]]
[[Category:INI Files Functions]]
+
 
[[Category:Lianja VFP Extensions]]
 
[[Category:Lianja VFP Extensions]]
 
[[Category:VFP Function Extensions]]
 
[[Category:VFP Function Extensions]]

Latest revision as of 08:17, 4 February 2013

Purpose

Function to return all the key/value pairs from a specified section of an 'ini' file

Syntax

INI_GETSECTION(<expC1>, <expC2>[, <expL>])

See Also

INI_GET(), INI_SET(), INI_SETSECTION()

Description

The INI_GETSECTION() function returns all the key/value pairs from a specified section of an 'ini' file. The value is returned as an object.

Parameter Description
<expC1> Name of the section.
<expC2> Name of the ini file.
<expL> .T. to expand macros, .F. to return macros without expanding. If this optional parameter is not included, macro expansion defaults to .F. (false).

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
obj_global = ini_getsection('global','test.ini')
? obj_global.key3
This is $(key2) and $(key1)