LordJashin Posted July 8, 2012 Share Posted July 8, 2012 (edited) Updated for section arrays [sCAR] function ReadINIArr(FileName: string; Sections, Keys: TStringArray): TStringArray; var i: Integer; begin Result := ['']; if (FileName = '') or (Length(Sections) < 1) or (Length(Keys) < 1) or (Length(Sections) <> Length(Keys)) then Exit; SetLength(Result, High(Sections) + 1); for i := 0 to High(Sections) do begin if INIKeyExists(Sections, Keys, FileName) then Result := ReadINI(Sections, Keys, FileName) else begin Result := ['']; Exit; end; end; end; function WriteINIArr(FileName: string; Sections, Keys, Values: TStringArray): Boolean; var i: Integer; B: Boolean; begin B := True; Result := False; if (FileName = '') or (Length(Sections) < 1) or (Length(Keys) < 1) or (Length(Values) < 1) or (Length(Keys) <> Length(Sections)) or (Length(Keys) <> Length(Values)) then Exit; for i := 0 to High(Sections) do if not WriteINI(Sections, Keys, Values, FileName) then B := False; Result := B; end; function DeleteINIArr(FileName: string; Sections, Keys: TStringArray): Boolean; var i: Integer; begin Result := True; if (FileName = '') or (Length(Sections) < 1) or (Length(Keys) < 1) or (Length(Sections) <> Length(Keys)) then Exit; for i := 0 to High(Sections) do if INIKeyExists(Sections, Keys, FileName) then DeleteINI(Sections, Keys, FileName); else Result := False; end;[/sCAR] Edited July 8, 2012 by LordJashin Quote Link to comment Share on other sites More sharing options...