All pastes #396655 Raw Edit

Mine

public text v1 · immutable
·published 2007-03-15 22:19 UTC
rendered paste body
//Insere na tabela de Itens de Pedidos
dm.TBPALMITENSPEDIDO.Open;
Str := TStringList.Create;
Str.LoadFromFile('C:\Sincronismo\dados\000179\dbItensPedido.txt');
for i := 0 to Str.Count -1 do
  begin
    S := Str[i];
  dm.TBPALMITENSPEDIDO.Insert;
  for X := 1 to 10 do
  begin
    dm.TBPALMITENSPEDIDO.FieldByName(Campo2[X]).AsString := Copy(S,1,Pos(#9,S)-1);
    Delete(S, 1, Pos(#9,S));
  end;
  dm.TBPALMITENSPEDIDO.FieldByName(Campo2[7]).AsString := Copy(S,1,Length(S));
  dm.TBPALMITENSPEDIDO.FieldByName(Campo2[8]).AsString := Copy(S,1,Length(S));
  dm.TBPALMITENSPEDIDO.FieldByName(Campo2[9]).AsString := Copy(S,1,Length(S));
  dm.TBPALMITENSPEDIDO.FieldByName(Campo2[10]).AsString := Copy(S,1,Length(S));
  dm.TBPALMITENSPEDIDO.FieldByName(Campo2[11]).AsString := Copy(S,1,Length(S));
  dm.TBPALMITENSPEDIDO.FieldByName(Campo2[12]).AsString := IntToStr(X);

  dm.TBPALMITENSPEDIDO.Post;
end;
Str.Free;