Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!elroy.jpl.nasa.gov!ncar!gatech!prism!jgb From: jgb@prism.gatech.EDU (James G. Baker) Newsgroups: comp.databases Subject: Re: How to TBROWSE with tags displayed in CLIPPER? Message-ID: <29365@hydra.gatech.EDU> Date: 18 May 91 21:18:27 GMT References: <16349.2833c71c@levels.sait.edu.au> Organization: Georgia Institute of Technology Lines: 54 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 = 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