Ir para conteúdo
Fórum Script Brasil
  • 0

(Resolvido) Mostrar andamento via Gauge


Eder

Pergunta

Ola,

Uma vez nosso colega Jonas me ensinou a trabalhar com o gauge copiando dados de arquivos TXT neste link

Mas agora eu tenho que copiar alguns campos de uma tabela paradox para outra tabela paradox e não estou conseguindo mostrar o resultado no gauge.

O codigo para copiar que estou usando é este:

procedure TForm1.XiButton11Click(Sender: TObject);

begin

Table1.Open;

Table2.Open;

{Copiar dados}

while not table1.Eof do

begin

Table2.Last;

Table2.Append;

Table2.Edit;

Table2.FieldByName('SIGLA_CTRC').Value := Table1.FieldByName('SIGLA_CTRC').Value;

Table2.FieldByName('NUMERO_CTRC').Value := Table1.FieldByName('NUMERO_CTRC').Value;

Table2.FieldByName('SITUACAO_CTRC').Value := Table1.FieldByName('SITUACAO_CTRC').Value;

Table2.FieldByName('DATA_EMISSAO').Value := Table1.FieldByName('DATA_EMISSAO').Value;

Table2.FieldByName('FIL_DEST').Value := Table1.FieldByName('FIL_DEST').Value;

Table2.FieldByName('KG_REAL').Value := Table1.FieldByName('KG_REAL').Value;

Table2.FieldByName('KG_CALCULO').Value := Table1.FieldByName('KG_CALCULO').Value;

Table2.FieldByName('VALOR_N_FISCAL').Value := Table1.FieldByName('VALOR_N_FISCAL').Value;

Table2.FieldByName('FRETE_VALOR').Value := Table1.FieldByName('FRETE_VALOR').Value;

Table2.FieldByName('ALIQUOTA').Value := Table1.FieldByName('ALIQUOTA').Value;

Table2.FieldByName('VLR_ICMS').Value := Table1.FieldByName('VLR_ICMS').Value;

Table2.FieldByName('DESPACHO').Value := Table1.FieldByName('DESPACHO').Value;

Table2.FieldByName('PEDAGIO').Value := Table1.FieldByName('PEDAGIO').Value;

Table2.FieldByName('OUTROS_IMPOSTOS').Value := Table1.FieldByName('OUTROS_IMPOSTOS').Value;

Table2.FieldByName('VALOR_FRETE').Value := Table1.FieldByName('VALOR_FRETE').Value;

Table2.FieldByName('NOME_VENDEDOR').Value := Table1.FieldByName('NOME_VENDEDOR').Value;

Table2.FieldByName('CONTADOR').Value := Table1.FieldByName('CONTADOR').Value;

Table2.FieldByName('ULT_OCORR_CODIGO').Value := Table1.FieldByName('ULT_OCORR_CODIGO').Value;

Table2.Post;

Table1.next;

end;

Showmessage('Dados Copiados');

end;

alguém poderia me ajudar?

Obrigado

Eder

Link para o comentário
Compartilhar em outros sites

2 respostass a esta questão

Posts Recomendados

  • 0
tenho que copiar alguns campos de uma tabela paradox para outra tabela paradox e não estou conseguindo mostrar o resultado no gauge

Faça essa modificação no código:

procedure TForm1.XiButton11Click(Sender: TObject);
var cont : integer;
begin

cont := 0; 

Table1.Open;
Table2.Open;
{Copiar dados}

gauge1.Progress:=0;
Gauge1.MaxValue := Table1.RecordCount;

while not table1.Eof do
begin

inc(cont);
gauge1.Progress:=cont;

Table2.Last;
Table2.Append;
Table2.Edit;
Table2.FieldByName('SIGLA_CTRC').Value := Table1.FieldByName('SIGLA_CTRC').Value;
Table2.FieldByName('NUMERO_CTRC').Value := Table1.FieldByName('NUMERO_CTRC').Value;
Table2.FieldByName('SITUACAO_CTRC').Value := Table1.FieldByName('SITUACAO_CTRC').Value;
Table2.FieldByName('DATA_EMISSAO').Value := Table1.FieldByName('DATA_EMISSAO').Value;
Table2.FieldByName('FIL_DEST').Value := Table1.FieldByName('FIL_DEST').Value;
Table2.FieldByName('KG_REAL').Value := Table1.FieldByName('KG_REAL').Value;
Table2.FieldByName('KG_CALCULO').Value := Table1.FieldByName('KG_CALCULO').Value;
Table2.FieldByName('VALOR_N_FISCAL').Value := Table1.FieldByName('VALOR_N_FISCAL').Value;
Table2.FieldByName('FRETE_VALOR').Value := Table1.FieldByName('FRETE_VALOR').Value;
Table2.FieldByName('ALIQUOTA').Value := Table1.FieldByName('ALIQUOTA').Value;
Table2.FieldByName('VLR_ICMS').Value := Table1.FieldByName('VLR_ICMS').Value;
Table2.FieldByName('DESPACHO').Value := Table1.FieldByName('DESPACHO').Value;
Table2.FieldByName('PEDAGIO').Value := Table1.FieldByName('PEDAGIO').Value;
Table2.FieldByName('OUTROS_IMPOSTOS').Value := Table1.FieldByName('OUTROS_IMPOSTOS').Value;
Table2.FieldByName('VALOR_FRETE').Value := Table1.FieldByName('VALOR_FRETE').Value;
Table2.FieldByName('NOME_VENDEDOR').Value := Table1.FieldByName('NOME_VENDEDOR').Value;
Table2.FieldByName('CONTADOR').Value := Table1.FieldByName('CONTADOR').Value;
Table2.FieldByName('ULT_OCORR_CODIGO').Value := Table1.FieldByName('ULT_OCORR_CODIGO').Value;
Table2.Post;
Table1.next;
end;
Showmessage('Dados Copiados');

gauge1.Progress:=0;

end;

abraço

Link para o comentário
Compartilhar em outros sites

Participe da discussão

Você pode postar agora e se registrar depois. Se você já tem uma conta, acesse agora para postar com sua conta.

Visitante
Responder esta pergunta...

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emoticons são permitidos.

×   Seu link foi incorporado automaticamente.   Exibir como um link em vez disso

×   Seu conteúdo anterior foi restaurado.   Limpar Editor

×   Você não pode colar imagens diretamente. Carregar ou inserir imagens do URL.



  • Estatísticas dos Fóruns

    • Tópicos
      152,2k
    • Posts
      651,9k
×
×
  • Criar Novo...