anchor.diff:  {$mode delphi}{$i xpc.inc}
   program dboutln;
  -uses xpc, cli, udb, udc, uapp, classes, kvm, cw, utv,
  -     ustr, db, sqldb, fx, ukm, kbd, num, undk, fs;
  +uses xpc, cli, udb, udc, udv, uapp, classes, kvm, cw, utv,
  +     num, fx, ukm, kbd, undk, fs;
   
   type
  -  TDBMenu = class (utv.TTermView)
  -    public
  -      rs : TRecordSet;
  -      key: string;
  -      OnSave : procedure (val:variant) of object;
  -      function Choose : variant;
  -    end;
     TDbOutCursor = class (udc.TDbCursor)
       public
         procedure Toggle;
       end;
     TDbOutlnApp  = class (uapp.TCustomApp)
       protected
  -      dbc  : udb.TDatabase;
  -      curs : TDbOutCursor;
  -      view : TDbTreeGrid;
  -      rsOutln : TRecordSet;
  -      typeMenu : TDBMenu;
  +      curs     : TDbOutCursor;
  +      dbc      : udb.TDatabase;
  +      view     : udv.TDbTreeGrid;
  +      typeMenu : udv.TDBMenu;
  +      rsOutln  : udb.TRecordSet;
       public
         procedure init; override;
         procedure keys(km : TKeyMap); override;
  
positive.code:   begin
      view.Redraw;
    end;
  
  function vinc(var i:integer):integer;
    begin
      result := i; i := i+1;
    end;
  
  function incv(var i:integer):integer;
    begin
      i := i+1; result := i;
    end;
  
  type tbytes = array of byte;
  function bytes(data : array of byte):tbytes;
    var i :integer;
    begin
      setlength(result, length(data));
      for i := 0 to high(data) do result[i]:=data[i];
    end; { bytes }
  
  procedure TDBOutLnApp.ChooseType;
    begin
  
negative.code:     ToMark;
      olid := _rs['olid'];
      nid  := _rs['nid'];
      if _rs['collapsed'] then
        sql := 'delete from outline_collapse where olid=olid:' +
  	     ' and collapse=nid:'
      else sql := 'insert into outline_collapse values (olid:,nid:)';
      _rs.dbc.RunSQL(sql, [olid, nid]);
      SetMark(_mk);
    end;
  
  
  begin
  