home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / database / 8924 < prev    next >
Encoding:
Text File  |  1993-01-08  |  1.4 KB  |  49 lines

  1. Newsgroups: comp.databases
  2. Path: sparky!uunet!caen!uvaarpa!maxwell!mha
  3. From: mha@Virginia.EDU ("Marty Altschul")
  4. Subject: Re: Help on CLIPPER DBEDIT()
  5. Message-ID: <1993Jan8.123925.15908@Virginia.EDU>
  6. Organization: University of Virginia
  7. References: <1993Jan4.163531.6968@almserv.uucp>
  8. Date: Fri, 8 Jan 1993 12:39:25 GMT
  9. Lines: 38
  10.  
  11. It is not an easy concept to get but the way to do a get within
  12. a tbrowse object is as follows:
  13.  
  14. create your column object as follows:
  15.  
  16. tc:=tbColumnNew('Heading', {| dummy_var | IIF( PCOUNT() > 0, ;
  17.                                          real_var := dummy_var,; 
  18.                                          real_var ) } )
  19. tb:addColumn( tc )
  20.  
  21. You will also need to create a keystroke handling function
  22. something like the following:
  23.  
  24. FUNCTION tbrowse( tb )
  25. LOCAL lk, browseExit := .F. 
  26. DO WHILE !browseExit
  27.    lk := INKEY(0)
  28.    IF lk == K_ESC
  29.       browseExit := .F.
  30.    ELSEIF lk == K_UP
  31.       tb:up()                 // same for all navigation keys
  32.    ELSEIF lk == K_ENTER .OR. ( lk > 32 .AND. lk < 128
  33.       IF lk <> K_ENTER
  34.          KEYBOARD CHR( lk )
  35.       ENDIF   
  36.       @ ROW(), COL() GET tb:colCurrent:block
  37.      READ
  38.      /* I forget the exact syntax here but the idea is to do a
  39.          normal @ GET and then an EVAL with the returned variable
  40.          so that the code block sees this as a different
  41.          instance than the ordinary screen write where there is 
  42.          no parameter.
  43.       */
  44.  
  45.     ENDIF
  46. ENDDO
  47.  
  48. I hope this helps somewhat
  49.