procedure LoadFileToStringList(sl: TStringList; FileName: string); const _BuffSize = 4096; // Cargamos en bloques de 4KB var c: char; i: integer; R: integer; H: integer; s: string; B: PChar; begin sl.Clear; B := PChar(AllocMem(_BuffSize + 1)); H := FileOpen(FileName, fmOpenRead or fmShareExclusive); if H < 0 then raise Exception.Create('Error abriendo fichero' + #13#10 + '"' + FileName + '"'); try repeat R := FileRead(H, B^, _BuffSize); for i := 0 to R - 1 do begin c := B[i]; if (c in [#13, #10, #0]) then begin if (s <> '') then sl.Add(s); s := ''; end else s := s + c; end; until R = 0; finally FileClose(H); FreeMem(B); end; end;