Ver Mensaje Individual
  #2  
Antiguo 07-09-2007
[basti] basti is offline
Miembro Premium
 
Registrado: ago 2004
Posts: 388
Reputación: 20
basti Va por buen camino
He leído en otro mensaje que entiendes el castellano escrito, así que te respondo en castellano:

En la función hay un error, debería retornar el valor de 'return'.

Por otro lado, puedes usar la función seek para ir a una posición del archivo directamente:


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);

  BlockRead(RAW,RAWData,BlockLength,BytesRead);

  for I := 1 to BlockLength do
    return := return + RAWData[i];

  ReadFromOffset := return;
  CloseFile(RAW);
  result := return;
end;
__________________
Saludos.
Responder Con Cita