[comp.databases] How to TBROWSE with tags displayed in CLIPPER?

marwk@levels.sait.edu.au (05/17/91)

We are beginners in the use of CLIPPER objects.

In particular, we would like to use TBROWSE to browse a single, indexed
DBF and while doing so use the Del, Ins, and other keys for processing the
records.

We want to tag various records for printing say, or sending somewhere else
after having tagged them - we want the tags to remain displayed on the screen
and redisplayed after returning to those records which have been tagged.

BTW we have not implemented a TBROWSE object at all yet.

Could someone please supply an example of this for use to work from.
This would be much appreciated.

Thank you in advance.
Ray and Mary

--
University of South Australia   | Plus ca change, plus c'est la meme chose.
P.O. Box 1                      | Ghing thien me how, ming thien gung me how.
Ingle Farm                      | Knobs, knobs everywhere,
South Australia                 |              just vary a knob to think!

jgb@prism.gatech.EDU (James G. Baker) (05/19/91)

In article <16349.2833c71c@levels.sait.edu.au> marwk@levels.sait.edu.au writes:
>We are beginners in the use of CLIPPER objects.
>In particular, we would like to use TBROWSE to browse a single, indexed
>DBF and while doing so use the Del, Ins, and other keys for processing the
>records.
>We want to tag various records for printing say, or sending somewhere else
>after having tagged them - we want the tags to remain displayed on the screen
>and redisplayed after returning to those records which have been tagged.

The TBDEMO.PRG is a good place to start.  It may be difficult to grasp at first,
but read through the TBROWSE and TBCOLUMN classes in the back of the reference
manual.  The TBDEMO uses the actual field names as column headings.  It 
does allow for an APPEND BLANK which is kinda dangerous.

I need to do more work on it, but I've got TBROWSE shell that:
	-Uses a small .dbf to drive it with the following for each field:
	   file_name"->"field_name
	   work area (if relation)
	   index #      (Set index to )  (=0 if no index)
	   index file
	   editable  (boolean)         
	   picture template for say/get
	-I then load all of these into arrays...there's prob a better 
	 memory conserving way... Tom?
	-Then when some function keys are hit I know:
	   if a field is seek/sortable via index
	   if a field can be changed 

That way I don't have to set up new functions for each database, just a new
.dbf to drive it.

The v5 TBROWSE is *great* for all the key handling.  After all the standard
stuff in the TBDEMO, add a test for <char> = K_DEL of whatever and go
DELE the record.  Add a column for:

IFF( Deleted(), "D", IFF( FILE->TAG, "T", " " ) )     and lock this column.

(Disclaimer for exact code... don't have my manual or ng with me.)

The v5.01 added some neat ways to deal with colors, etc if you want to 
make the field a certain color if tagged, deleted, etc.

Keep in mind that the TBDEMO uses the dBcreate (or whatever) which 
set up the tbrowse structure for a dbf instead of any old data structure.
(skipper, etc)

Have fun.

-Jim Baker
-- 
BAKER,JAMES G - Undergraduate Lab Instructor, School of Electrical Engineering
____  _    _    Georgia Institute of Technology, Atlanta Georgia, 30332
  |  | _  |_)   uucp: ...!{decvax,hplabs,ncar,purdue,rutgers}!gatech!prism!jgb 
(_|. |_). |_).  Internet: jgb@prism.gatech.edu, jgb@ee, jgb@eecom, jgb@cc