Ver Mensaje Individual
  #1  
Antiguo 21-12-2011
jars jars is offline
Miembro
 
Registrado: mar 2004
Posts: 283
Reputación: 23
jars Va por buen camino
copiar un array mas grande en otro mas chico

Hola amigos, tengo el siguiente problema:

Código Delphi [-]
type  
  TFrame20ms = packed record
    Lc: SmallInt;   // canal izquierdo
    Rc: SmallInt;   // canal derecho
  end;

En un procedimiento defino lo siguiente:
Código Delphi [-]
const
  RBUFLEN = 32000 / 4;
var
  rbuf: array of TFrame20ms;
  fbuf: array of TFrame20ms;
begin
  SetLength(rbuf, RBUFLEN);
  SetLength(fbuf, 160); //160 elementos
  ....
  rcnt := FileRead(InHandle, rbuf[0], RBUFLEN * SizeOf(rbuf[0]));

  l := 0;
  h := 159;
  for i := 1 to NumFrames do
  begin
    //  este es el problema
    // necesito ir avanzando en el array rbuf tomando en cada iteracion 160 elementos
    // e ir copiandolos en el array fbuf. Que hago mal porque solo me copia el primer elemento en cada pasada.
    Move(rbuf[l], fbuf[0], SizeOf(fbuf));
    .....
    l := h+1;
    h := h+160;
    ....
  end;

Gracias y espero haberme explicado.
Responder Con Cita