ConfigFile ReadSection

This command reads a carriage return separated list of all the entries for the specified section of a configuration file.

Syntax

ConfigFile ReadSection var, section, file, [max_size]

Synonyms

CN RS

Parameters

The following table describes the parameters of the ConfigFile ReadSection command:

Parameter Description
var Name of the variable to be updated with the value of the entry
section Section name in the configuration file
file Configuration file name
max_size Maximum size of value of entry; default 2048 characters. If the size of the return value is greater than max_size, it is truncated.

Examples

The following example reads a section in a configuration file. The C:\wintuser.ini configuration file has the following section:

[User]
Surname=Robertshaw
First Name=David

* Get list of entries in user section.
* In this case = "Surname":cr:"First Name"
ConfigFile ReadSection user_entries, "User", "c:\wintuser.ini"

Related Script Commands

ConfigFile Read, ConfigFile ReadInteger, ConfigFile Write