at læse en hel del fra en inifile

, hvordan at læse en hel del fra en ini fil.,, [skal], 1000 = noget, 1,2, 1000 = dosomethingelse, 3,4,,, når der anvendes tinifile.readsectionvalues kun én af disse punkter vil blive returneret.Here is a procedure which will read the whole section.,,, procedure ReadWholeIniSection(FileName: string; SectionName: string; Strings: TStrings);,, var,, P: PChar;,, Buffer: PChar;,, BufferSize: Integer;,, begin,, Strings.BeginUpdate;,, BufferSize := 10 * 1024 * 1024;,, GetMem(Buffer, BufferSize);,, try,, BufferSize := GetPrivateProfileSection(PChar(SectionName), Buffer, BufferSize, PChar(FileName));,, if BufferSize = 0 then,, Exit;,, P := Buffer;,, while P^ <> #0 do , ,, begin,, Strings.Add(P);,, Inc(P, StrLen(P) + 1);,, end;,, finally,, Strings.EndUpdate;,, if Assigned(Buffer) then,, FreeMem(Buffer);,, end;,, end;,,



Previous:
Next Page: