| xHarbour Reference Documentation > Function Reference |
![]() |
![]() |
![]() |
Creates a new TBrowse object to be used with a database.
TBrowseDB( [<nTop>] , ;
[<nLeft>] , ;
[<nBottom>], ;
[<nRight>] ) --> oTBrowse
TBrowseDB() returns new TBrowse object with the specified coordinate and a default :skipBlock, :goTopBlock and :goBottomBlock to browse a database.
TBrowseDB() is a quick way to create a TBrowse object along with the minimal support needed to browse a database. Note that the returned TBrowse object contains no TBColumn objects. They must be added for each field to display in the browse window.
| See also: | Browse(), DbEdit(), TBColumn(), TBrowse(), TBrowseNew() |
| Category: | Object functions |
| Source: | rtl\tbrowse.prg |
| LIB: | xhb.lib |
| DLL: | xhbdll.dll |
// The example builds a simple TBrowse object for a database
#include "TBrowse.ch"
PROCEDURE Main
LOCAL oTBrowse, aFields, cField, nKey
USE Customer
aFields := Array( FCount() )
AEval( aFields, {|x,i| aFields[i] := FieldName(i) } )
oTBrowse := TBrowseDB()
WITH OBJECT oTBrowse
FOR EACH cField IN aFields
:addColumn( TBColumnNew( cField, FieldBlock( cField ) ) )
NEXT
END
DO WHILE .T.
oTBrowse:forceStable()
nKey := Inkey(0)
IF oTBrowse:applyKey( nKey ) == TBR_EXIT
EXIT
ENDIF
ENDDO
CLOSE Customer
RETURN
http://www.xHarbour.com