Trying to get this to work.. Any comments, ideas, etc. are welcome.
It works, but does not "return" anything in it's current state:
code:
CLS
BREAK ON
;ENUMINI
$fl=@scriptdir+'\test.ini'
$rc=ENUMINI($fl)
$rc
sleep 2
FUNCTION ENUMINI($fl)
DIM $fl,$line,$section,$key,$r
IF EXIST($fl)
$rc=Open(1,$fl)
$line=ReadLine(1)
WHILE @error=0
IF LEFT($line,1)=';' ;IGNORE COMMENTS
ENDIF
IF LEFT($line,1)='['
$section=substr($line,2,len($line)-2)
ENDIF
IF NOT INSTR($line,'[')
$key=SPLIT($line,'=')[0]
ENDIF
IF $section<>'' AND $key<>'' ;Be sure both of these are populated
;sections and keys are done, let's do the READPROFILESTRING
$r=READPROFILESTRING($fl,$section,$key)
ENDIF
$line=ReadLine(1)
LOOP
close(1)
ENDIF
ENDFUNCTION
TEST.INI is -
code:
[DOMAIN1\PDX]
;H='\\SERVER7\'+@userid+'$$'
R=\\SERVER5\APPS
S=\\SERVER6\SHARED
[DOMAIN2\PDX]
H='\\SERVER7\'+@userid+'$$'
R=\\SERVER5\APPS
S=\\SERVER6\SHARED
[DOMAIN1\Info_Technology]
G=\\SERVER7\IS
Thanks,
Kent