Ver Mensaje Individual
  #1  
Antiguo 04-08-2008
Avatar de Carmelo Cash
Carmelo Cash Carmelo Cash is offline
Miembro
 
Registrado: jul 2003
Ubicación: Buenos Aires
Posts: 261
Reputación: 21
Carmelo Cash Va por buen camino
Opinión sobre un código

Hola Foro:

Este código borra un registro de un RXMemoryData.
Cuando hago in click en el dbgrid, cargo la variable ID_INI y luego para borrar hago una busqueda secuencial desde el primer registro hasta el último. Si por una de esas no está OK queda en False y no hago nada.
Esto anda bién, pero me parece mucha cosa para borrar un registro.

Qué opinión les merece?. Desde ya muchas gracias por su opinión.


Código Delphi [-]
 
  with RxMDCompleto do begin
    OK:=False;
    First;
    while not(eof) do begin
      if fieldByName('ID_INI').AsInteger=ID_INI then begin
        OK:=True;
        Break;
      end;
      next;
    end;    // while

    if OK=True then begin
      Delete;
    end;
  end;
Responder Con Cita