ReadSectINI 

                   (System Library)

Description:              This subroutine reads an entire section entry from an .INI file or a buffer containing one and returns a 2-dimensional array containing variable names and their values.

Returns:                    Array

Usage:                       Script

Format:                      \System\ReadSectINI(File, Section [[, UseBuff] , PtrSectionStatus )

Parameters:             File  { text }  { required }  { no default: }

                                      Any text expression giving the full path and file name of the .INI file or the name of the buffer containing its contents.

                                    Section  { text }  { required }  { no default: }

                                      Any text expression giving the name of the section in the file; this should not include the square brackets delimiting the section.

                                    UseBuff  { Boolean }  { optional}  { default: FALSE }

                                      An optional parameter that is any logical expression; if true (non-0) the value of File must be a pointer to a buffer, if false (0) it is a file that is to be used. The default used if this parameter is omitted is false.

                             PtrSectionStatus  { numeric }  { optional }  { no default: }

                                      A flag used to inform the caller of what was found, according to the following table:

Value

Meaning

Invalid

when either of the first 2 parameters are invalid

0

when both section and settings exist

1

when no section is found

2

when section is found, but not settings

 

Comments:               This subroutine is a member of the System Library, and must therefore be prefaced by \System\, as shown in the "Format" section. If the application you are developing is a script application, the System variable must be declared in APPMOD.SRC and need not be prefaced by a backslash in the function call.

                             The array that is returned gives the variable names in its first row (Array[0][N]) and the variables' values in its second row (Array[1][N]). The return value will be invalid if the .INI file or section was not found, or if the section did not contain any variables. Searches performed by this function are case insensitive.

Example:

If 1 Main;

[

  Vars = System\ReadSectINI("Config.INI" { Name of file }, 

                            "System" { Name of section }, 

                            0 { Read file format }); 

]

This creates the array Vars and stores in it all variables in the System section of the Config.INI file.

See Also:

CheckFileExist | CheckPathExist | ReadINI | WriteINI | WriteSectINI |