home *** CD-ROM | disk | FTP | other *** search
-
- // example: the 'matches' operator
-
-
- input "example.ini"
-
- // 'section' keeps track of the current section
- set section equal to ""
-
- // scan the .INI file ...
- do while (someLeft input)
-
- // read a line from the .INI file
- read
-
- // ignore blank lines
- if (line="")
- // (do nothing)
-
- // extract section from "[...]" lines
- elseif (line matches "[~(section)]")
- // (nothing else to do ù 'section' has been set)
-
- // process "variable=value" lines
- elseif (line matches "~(variable)=~(value)")
- error "setting found before first section name" if (section="")
- write (section ":" variable ":" value)
-
- else
- error ("unrecognised line: " line)
- endif
-
- // comment out the next line to make the program run faster
- refresh
-
- loop
-