// ïåðåêîäèðîâêà øòðèõêîäîâ

var

  table :TQuery;

begin

  Table := TQuery.create(nil);
  try
    Table.databasename := 'dbkassa';
    Table.sql.text  := 'select * from tovar where floatbarcode = 1';

    table.open;
    with TMyWait.create('Èäåò çàìåíà êîäîâ') do
    try
        (*
        text := 'ïðåäâàðèòåëüíàÿ çàìåíà';
        Progressbarmax := table.recordcount;
        Progressbarpos := 0;
        while not table.eof do
        begin
          incprogress;

          UpdateNN(table.fieldbyname('nn').asstring,'nn_'+copy(table.fieldbyname('nn').asstring,1,2)+ table.fieldbyname('barcode').asstring, false,false);
          table.next;
        end;

        text := 'îêîí÷àòåëüíàÿ çàìåíà';
        *)

        Progressbarmax := table.recordcount;
        Progressbarpos := 0;
        table.first;
        while not table.eof do
        begin
          incprogress;

          UpdateNN(
             table.fieldbyname('nn').asstring,
             'ÂÅ'+formatfloat('0000', strtofloatprotected(table.fieldbyname('barcode').asstring)), false);
          table.next;
        end;
    finally
      free
    end;
  finally
    Table.free;
  end;
end.

