Switch to Russian Home page of Alexander Kresin
Main Clipper HwGUI Five stones File utilities
Links KS Organizer My photo

Function Rdini was written for loading memvars from ini files. This allow to change behavior of the application, to control its execution without changing source code. The main feature of Rdini is possibility to load codeblocks and arrays of any structure.

Function Rdini scans file line by line, creates variables ( if they doesn't declared yet ) as Public and assignes them values.

File format:

...
[SECTION1_NAME]
...
[SECTION2_NAME]
...

Function reads variables from beginning of file until first section and from sections, named in function call.
Comments must have symbol ';' in the first position of a line.
Symbol '&' indicate continue on the next line.

Variables may be logical:

var_name=On
var_name=Off
var_name=
character:
var_name="stroka"
numeric:
var_name=999
codeblock:
var_name={|| ... }
array of any structure, including all types of variables:
arr_name={ ... { ... } ... }

Syntax:

Rdini ( ini_file_name, [section1_name], [section2_name], ;
     [section3_name], [section4_name] ),
     where ini_file_name - name of .ini - file you want to read, section1_name, ..., section4_name - names of sections in .ini - file which you want to read.

[Download prcini.zip - source code with sample][Return to the clipper page].

Hosted by www.Geocities.ws

1