I can probably clean this up some more. It prints to screen the operators and the conditional values if they are not REDIMmed.

Any updates/ideas to this are welcome.

The inspiration for this is to compact down the structure checking/setting of files.
Code:

;Function INIUPDATE()
;
;Author Kent Dyer (leptonator@hotmail.com)
;
;Action Updates an INI file on an array.
;
;Syntax INIUPDATE("File","section","key","string",optional "operator")
;
;Version 0.5
;
;Date 25 March 2004
;
;Date Revised 25 March 2004
;
INIUPDATE($file,$section,$key,$string,optional $operator)
;Parameters File
; File you are checking/modifying
;
; Section
; Section header you want to target in the file
;
; Key
; Which Key under the Header you are checking
;
; String
; Resulting string you are checking/setting
;
; Operator (optional)
; Default is <> or the Not operator, You could
; use =, >=, <=, etc.
;
;Remarks This is to read in a structure of variables and conditions
; This process then splits them out and checks and uses them.
; This could be used for READVALUE/WRITEVALUE too.
;
;Returns Nothing
;
;Dependencies None
;
;KiXtart Ver 4.02
;
;Example(s)
; $rc=SETOPTION('Explicit','On')
; $rc=SETOPTION('NoVarsInStrings','On')
; DIM $profiledir,$prf,$prffile,$g,$header,$k
; $profiledir='%temp%'
; $prf='Outlook.prf'
; $prffile=$profiledir+'\'+$prf
;
; FOR EACH $g IN Split('ProfileName @userid,DefaultProfile Yes,OverwriteProfile Yes,BackupProfile No',',')
; $header='General'
; $g=SPLIT($g)
; INIUPDATE($prffile,$header,$g[1],$g[0])
; NEXT
; Code
FUNCTION INIUPDATE($file,$section,$key,$string,optional $operator)
DIM $rc
IF NOT $operator
$operator='<>'
ENDIF
REDIM $operator
IF $string $operator ReadProfileString($file,$section,$key)
$rc=WriteProfileString($file,$header,$key,$string)
ENDIF
ENDFUNCTION



Thanks,

Kent
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's