Have the following code structure for updating the PRF File for Outlook (Configuration of Outlook/Exchange FAQ)..
Code:

; -- OTHER CODE
IF @userid<>ReadProfileString($prffile,'General','ProfileName')
$rc=WriteProfileString($prffile,'General','ProfileName',@userid)
ENDIF
IF 'Yes'<>ReadProfileString($prffile,'General','DefaultProfile')
$rc=WriteProfileString($prffile,'General','DefaultProfile','Yes')
ENDIF
IF 'Yes'<>ReadProfileString($prffile,'General','OverwriteProfile')
$rc=WriteProfileString($prffile,'General','OverwriteProfile','Yes')
ENDIF
IF 'No'<>ReadProfileString($prffile,'General','BackupProfile')
$rc=WriteProfileString($prffile,'General','BackupProfile','No')
ENDIF
; -- OTHER CODE



Now, I got to thinking how to get this to go through consistently, but seems to not produce correct results.
Code:

FOR EACH $FIRST IN Split('ProfileName DefaultProfile OverwriteProfile BackupProfile')
FOR EACH $SECOND IN Split('@USERID Yes Yes No')
IF $SECOND<>ReadProfileString($prffile,'General',$FIRST)
$rc=WriteProfileString($prffile,'General',$FIRST,$SECOND)
ENDIF
NEXT
NEXT



For convenience sake, I put together a piece of test code to verify this -
Code:

CLS
BREAK ON
FOR EACH $FIRST IN Split('ProfileName DefaultProfile OverwriteProfile BackupProfile')
FOR EACH $SECOND IN Split('@USERID Yes Yes No')
;IF $SECOND<>ReadProfileString($prffile,'General',$FIRST)
; $rc=WriteProfileString($prffile,'General',$FIRST,$SECOND)
;ENDIF
?$First+','+$second
NEXT
NEXT
get $k



I have also tried -
Code:

BREAK ON
FOR EACH $FIRST IN Split('ProfileName DefaultProfile OverwriteProfile BackupProfile')
PASSTHRU($First)
NEXT
FUNCTION PASSTHRU($First)
FOR EACH $SECOND IN Split('@USERID Yes Yes No')
;IF $SECOND<>ReadProfileString($prffile,'General',$FIRST)
; $rc=WriteProfileString($prffile,'General',$FIRST,$SECOND)
;ENDIF
?$First+','+$second
NEXT
ENDFUNCTION
get $k



Thanks,

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