This month's column applies the general "object-based" concepts defined last month by showing how to use two CA-Clipper predefined classes: TBrowse and TBColumn. These classes have made Clipper's previous database browsing technology, DBEDIT[unkeyable], obsolete. DBEDIT[unkeyable] is a built-in function that can still be use, but there's little reason to do so. (In the manual it's listed as a Summer '87 compatibility function.) Clipper's current data browsing facilities far surpass anything previously available in this language or any other Xbase dialect. The key is the object-oriented direction of the browsing technology in Clipper 5.
We'll use the term TBrowse to encompass Clipper's browsing technology and it should be understood that this includes both the TBrowse and TBColumn classes. Moreover, TBrowse can be used to browse not just information coming from a database, but any tabular data as well. For instance, arrays and DOS text files may be browsed via TBrowse.
The TBrowse and TBColumn classes
To browse tabular data in Clipper, you must use the TBrowse and TBColumn predefined classes. We use the TBrowse class to create and manipulate objects used as the primary mechanism for browsing table oriented data.
A TBrowse object depends on one or more TBColumn objects. The TBColumn class is used to create and manipulate objects used with TBrowse objects. A TBColumn object contains all the specifications required to define a single column of a TBrowse object.
Both classes have constructor functions used to create an instance of each class, also known as an "object." For TBrowse, there are the TBrowseNew[unkeyable] and TBrowseDB[unkeyable] constructors, and for TBColumn there is TBColumnNew[unkeyable].
In addition, there's a set of exported instance variables for both classes. Table 1 summarizes these variables including the variable's name, data type, and whether it's assignable or not. Think of the word "exported" to mean visible to the programmer to assign new values or access the value of the variable. In true object-oriented programming (OOP) languages where you can create classes, non-exported instance variables become possible. In this case, the variables are used only …