Function:
Syntax - Mode 1:
result = SysIni([inifile], app, key, val)
result = SysIni([inifile], app, key)
result = SysIni([inifile], app, key, 'DELETE:')
result = SysIni([inifile], app, ['DELETE:'])
result = SysIni([inifile], app, 'ALL:', 'stem')
result = SysIni([inifile], 'ALL:', 'stem')
The error string 'ERROR:' may be returned if an error occurs:
Possible error conditions:
o
┴╓: This function works on all types of data stored in an INI file (text, numeric, or binary).
/* Sample code segments */
/*** Save the user entered name under the key 'NAME' of *****
**** the application 'MYAPP'. ****/
pull name .
call SysIni , 'MYAPP', 'NAME', name /* Save the value */
say SysIni(, 'MYAPP', 'NAME') /* Query the value */
call SysIni , 'MYAPP' /* Delete all MYAPP info */
exit
/**** Type all OS2.INI file information to the screen *****/
call rxfuncadd sysloadfuncs, rexxutil, sysloadfuncs
call sysloadfuncs
call SysIni 'USER', 'All:', 'Apps.'
if Result \= 'ERROR:' then
do i = 1 to Apps.0
call SysIni 'USER', Apps.i, 'All:', 'Keys'
if Result \= 'ERROR:' then
do j=1 to Keys.0
val = SysIni('USER', Apps.i, Keys.j)
say left(Apps.i, 20) left(Keys.j, 20),
'Len=x'''Left(d2x(length(val)),4) left(val, 20)
end
end