Club Delphi  
    Paypal   FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > Varios
Registrarse FAQ Miembros Calendario Guía de estilo Buscar Temas de Hoy Marcar Foros Como Leídos

Coloboración Paypal con ClubDelphi

 
 
Herramientas Buscar en Tema Desplegado
  #10  
Antiguo 18-12-2012
Avatar de Cristhor1982
Cristhor1982 Cristhor1982 is offline
Miembro
NULL
 
Registrado: dic 2012
Posts: 60
Poder: 14
Cristhor1982 Va por buen camino
Código Delphi [-]
procedure TFR_EliminacionFolioMasivo.SG1KeyDown(Sender: TObject;
  var Key: Word; Shift: TShiftState);
var
  TS: TStrings;
  j,i : Integer;
begin
if ((ssCtrl in Shift) and (Key = 86)) or ((ssShift in Shift) and (Key = 45)) then
  if Clipboard.HasFormat(CF_TEXT) then
    with SG1 do
    begin
      TS := TStringList.Create;
      try
        TS.Text := clipboard.AsText;
        RowCount := TS.Count+1;
        for i:= 0 to TS.Count-1 do
        begin


          Cells[SG1.Col,SG1.Row+i]:= TS[i];   //desde row 1

          screen.Cursor := crsqlwait;
          fr_clave.SQL.Close;
              fr_clave.SQL.SQL.Clear;
              fr_clave.SQL.SQL.Add('EXEC_aCTeLIMINACIONfOLIOv2 1,0,');
              if ((Cells[1,1+i]<>'')AND ((Cells[2,1+i])<>'')) then
                begin
                 fr_clave.SQL.SQL.Add(''''+ Cells[1,1+i] +''',''' + Cells[2,1+i] +''',0,0,0,');
                 end
                 else
                 if ((Cells[1,1+i]<>'') AND (Cells[2,1+i]='')) then
                 begin
                 fr_clave.SQL.SQL.Add(''''+ Cells[1,1+i] +''',-1,0,0,0,')
                 end
                else
                fr_clave.SQL.SQL.Add('-1,''' + Cells[2,1+i] +''',0,0,0,');
                fr_clave.SQL.SQL.Add(''''+ fr_clave.TX_Rut.Text +''',0,0,0');
                fr_clave.SQL.Open;
                  if fr_clave.SQL.RecordCount <> 0 then
                  BEGIN

                 // SG1.RowCount :=SG1.RowCount+1;
                  SG1.Cells[1,i+1 ] := fr_clave.SQL['Folio'];
                  SG1.Cells[2,i+1 ] := fr_clave.SQL['Vale'];
                  SG1.Cells[3,i+1 ] := fr_clave.SQL['Periodo'];
                  SG1.Cells[4,i+1] := fr_clave.SQL['RutVisador'];
                  SG1.Cells[6,i+1 ] := fr_clave.SQL['RutVisado'];
                  SG1.Cells[8,i+1 ] := fr_clave.SQL['Motivo'];
                  SG1.Cells [5,i+1 ] := NombreTrabajador(SG1.Cells[4,i+1]);
                  SG1.Cells [7,i+1 ] := NombreTrabajador(SG1.Cells[6,i+1]);

          end;
          for j := 0 to 8 do
          begin
          SG1.Cells[j, SG1.RowCount] := '';
          end;
          end;
      finally
        screen.Cursor := crdefault;
        TS.Free;
        //clipboard.Clear;

    end;
end
  else
    ShowMessage('No hay texto en el PortaPapeles');
end;



Esto esta funcionando "Bien", pero necesito que los valores Vacios de lo que copio no los inserte, trate con un IF TS[i]='' then..etc
pero no puedo, alguien que me de una pista
Responder Con Cita
 


Herramientas Buscar en Tema
Buscar en Tema:

Búsqueda Avanzada
Desplegado

Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro

Temas Similares
Tema Autor Foro Respuestas Último mensaje
Copiar/pegar desde el Clipboard a otra Aplicación broly7 Varios 4 07-03-2011 17:08:53
Pegar imagen desde el Portapapeles (Clipboard) gluglu Gráficos 8 20-10-2010 15:09:55
tabla a clipboard picap Varios 4 13-05-2010 08:23:07
Copiar Y Pegar texto en las celdas de un StringGrid rgstuamigo OOP 2 01-12-2008 13:55:51
Una clase al ClipBoard bustio OOP 2 07-07-2004 00:35:16


La franja horaria es GMT +2. Ahora son las 10:24:45.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi