Ver Mensaje Individual
  #3  
Antiguo 07-09-2007
scriptors scriptors is offline
Registrado
 
Registrado: sep 2007
Posts: 5
Reputación: 0
scriptors Va por buen camino
encantado

from 25 sec -> to 1 sec
correct little 'bug'

Código Delphi [-]
 
Function TMainForm.ReadFromOffset(const RAWFile: String; OffsetI: integer;BlockLength:Integer): string;
var
  RAW: file;
  BytesRead: integer;
  RAWData: array[1..5000] of char;
  I: integer;
  c: pointer;
  return: string;
begin
  BytesRead := -1;
  return := '';
  AssignFile(RAW, RAWFile);
  Reset(RAW,1);
  Seek(RAW, OffsetI); // - 1 NOT necessary 
 
  BlockRead(RAW,RAWData,BlockLength,BytesRead);
 
  for I := 1 to BlockLength do
    return := return + RAWData[i];
 
  ReadFromOffset := return;
  CloseFile(RAW);
  result := return;
end;
Responder Con Cita