(*****************************************************************************)
(* MODULE: BTRLOCAL*                                                         *)
(* RIGHTS: Reggatta Systems - COPYRIGHT 1995 - 2000                          *)
(* DESCR.: This module contains a function for accessing Btrieve at a Low    *)
(*         Level.                                                            *)
(*                                                                           *)
(*                                                                           *)
(* NOTES:  This function allows a TTable to be passed as a parameter and     *)
(*         the function returns a TWinBtr object.  TWinBtr provides all of   *)
(*         low-level access to Btrieve.                                      *)
(*                                                                           *)
(*****************************************************************************)
Unit BtrLocal;
{$I BSE.INC}
Interface
Uses
  BtrMain,
  BtrTable,
  BtrWObj;

Function GetBtrieveObject( T : TtbTable ) : TWinBtr;

Implementation
Uses
  BseCache;

Function GetBtrieveObject( T : TtbTable ) : TWinBtr;
begin
  Result := NIL;
  If Assigned( T ) and ( T.Handle <> NIL ) then
  begin
    If Not T.CachedUpdates then
      Result := TBtrTable( T.Handle ).Handle
    else
      with TBaseCacheTable( T.Handle ) do
        If Assigned( MainCursor ) then
          Result := TBtrTable( MainCursor ).Handle;
  end;
end;


end.

