home *** CD-ROM | disk | FTP | other *** search
/ C!T ROM 2 / ctrom_ii_b.zip / ctrom_ii_b / PROGRAM / CLIPPER / GETBOX / TEST.PRG < prev   
Text File  |  1993-12-16  |  2KB  |  42 lines

  1. /*┌──────────────────────────────────────────────────────────────────────┐
  2.  ▌│ Program Name: TEST.PRG          Copyright: PUBLIC DOMAIN             │
  3.  ▌│ Date Created: 12/16/93           Language: Clipper 5.0               │
  4.  ▌│ Time Created: 00:15:53             Author: Kevin S Gallagher         │
  5.  ▌├──────────────────────────────────────────────────────────────────────┤
  6.  ▌│ This sample shows how to do a simple @...GET inside of FT_XBOX()     │
  7.  ▌│ Nothing fancy!                                                       │
  8.  ▌└──────────────────────────────────────────────────────────────────────┘
  9.  ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀ */
  10.  
  11. #xtranslate FT_Space( <s> )     =>  ;
  12.     replicate( chr(255), len( <s> ) )
  13.  
  14. function main
  15.     local getlist := {}, cString := space(20), nCursor := setcursor(2)
  16.  
  17.     SET SCOREBOARD OFF
  18.  
  19.     dispbox(0,0,maxrow(),maxcol(),"░░░░░░░░░","B+/B")
  20.     FT_XBOX(,,,"w+/bg","gr+/bg",1,,"FT_BOX AS A GETBOX",;
  21.         "Cool little trick huh!";
  22.     )
  23.  
  24.     /*
  25.     * The trick here is to pad the prompt with spaces, which must
  26.     * be with chr(255) and not chr(32), because ft_xbox() will do
  27.     * a trim on the string/prompt. Why add the extra spaces? This
  28.     * allows the get to be placed inside of the box.
  29.     */
  30.     FT_XBOX(,,,,"w+/g","w+/g",,"ENTER YOUR NAME:"+ FT_Space(cString) )
  31.  
  32.     /*
  33.     * Position the get at the end of the last line in ft_xbox
  34.     */
  35.     @row(),col()-len(cString) get cString color "rb+/n"
  36.     read
  37.  
  38.     setcursor(nCursor)
  39.     @maxrow(),0
  40.     setpos(maxrow()-1,0)
  41. return(.t.)
  42.