Страница 1 из 1

Обновление таблицы

Добавлено: 11 дек 2006, 10:24
Alexander

Код: Выделить всё

Interface testtable 'test' doaccept, cyan;
   show at (,,80,40)
   table struct TableOrgs(
      nrec    : Comp   ,
      crec    : Comp   ,
      name    : String
   )with index (byNrec = nrec);

   Create View TreeView
      var
        cOwner  : Comp;
        ccc : Comp;
     kvartal : word;
      select
         *
      from TableOrgs;

create view sm
     select  *  from saldmoun  where ((
        date(10,9,05)<<=saldmoun.datesal and        
        date(10,11,06)>>=saldmoun.datesal));
//------------------------------ Begin InitTables  ------------------------------
procedure InitTables;
{
   StartNewVisual(vtRotateVisual, vfTimer, 'Формирование дерева...',1);
   sm._Loop{
      ClearBuffer(#TableOrgs );
     ccc := sm.saldmoun.kauos[1];
  if(modifier getfirst       TableOrgs        where
      ((ccc==TableOrgs.nrec))<>tsOK){
      TableOrgs.nrec    :=  ccc;
      TableOrgs.name  :=  string(ccc);
      Insert Current TableOrgs;
   }
     }
   StopVisual('',0);
     message(getfirst       TableOrgs);
     RereadRecord(#TableOrgs);
     rescanPanel(#TableOrgs);
}
//------------------------------ End InitTables ------------------------------
browse bbb
     show at(,,,);
     table TableOrgs;
     fields
       TableOrgs.name;
end;
   handleEvent
      cmInit:{
         InitTables;
      }
   end;
End. 
Таблица не обновляется... в чем причина? как быть?

Добавлено: 13 дек 2006, 05:20
Hmyrii
вот я копирнул твой код
скомпилил и запустил ресник
у меня в сальдо шесть записей
все шесть записей я и увидел в browse
правдо я все таки кое что подправил
найди пять отличий

Код: Выделить всё

interface testtable 'test' doaccept, cyan;
   show at (,,80,40)
   table struct TableOrgs
   (
      nrec    : comp,
      crec    : comp,
      name    : string
   )
   with index
   (
     byNrec = nrec
   );

   create view TreeView
      var
        cOwner  : Comp;
        ccc     : Comp;
        kvartal : word;
      select * from TableOrgs;

   create view sm select * from saldmoun;

//------------------------------ Begin InitTables  ------------------------------
procedure InitTables;
{
   StartNewVisual(vtRotateVisual, vfTimer, 'Формирование дерева...',1);
   sm._Loop
   {
      ClearBuffer(#TableOrgs );
      ccc := sm.saldmoun.kauos[1];
      if GetFirst TableOrgs where ((ccc == TableOrgs.nrec)) <> tsOK
      {
        TableOrgs.nrec    :=  ccc;
        TableOrgs.name  :=  string(ccc);
        Insert Current TableOrgs;
      }  
   }
   StopVisual('',0);
   RereadRecord(#TableOrgs);
   rescanPanel(#TableOrgs);
}
//------------------------------ End InitTables ------------------------------

  browse bbb;
    table TableOrgs;
    fields
      TableOrgs.name;
  end;
   
  HandleEvent
    cmInit:
    {
      InitTables;
    }
  end;
end.

Добавлено: 13 дек 2006, 12:35
Alexander
Нормально работает вы правы! Просто "ручник опустил" - и заработало! :D