All pastes #396590 Raw Edit

Untitled

public text v1 · immutable
·published 2007-03-15 21:34 UTC
rendered paste body
//******************************************************************
// TABELA CONFIG.
//******************************************************************
//Abre a tabela do banco de dados
  dm.TBPALMCONFIG.Open;

for i:= 01 to 60 do
  begin
  k_espaco:= k_espaco+' ';
  // k_espaco:= k_espaco+'------------------------------------------------------------';
end;

k_zeros:= Char(9);
espaco_inicial := '';
AssignFile(F,'C:\Sincronismo\Dados\TBPALMCONFIG.txt');
Rewrite(F);

while not dm.TBPALMCONFIG.EOF do
begin

k_codrepresentanteCONFIG := copy(espaco_inicial,1,(6-Length(dm.TBPALMCONFIG.FieldByname('CODREPRESENTANTE').Value))) + dm.TBPALMCONFIG.FieldbyName('CODREPRESENTANTE').Value;
k_nomeCONFIG := copy(k_zeros,1,(50-Length(dm.TBPALMCONFIG.FieldByname('NOME').Value))) + dm.TBPALMCONFIG.FieldbyName('NOME').Value;

// Aqui grava o arquivo TBPALMCONFIG.txt
Writeln(F,'X',k_codrepresentanteCONFIG,k_nomeCONFIG);
dm.TBPALMCONFIG.Next;
end;
  closeFile(F);
  lblResultadoCONFIG.Caption := 'Foram exportados: '+ IntToStr(dm.TBPALMCONFIG.RecordCount)+' registros da tabela CONFIG.';
  dm.TBPALMCONFIG.Close;