home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 5 / 05.iso / a / a012 / 1.ddi / CHAP06.EXE / CHP0614.PRG < prev   
Encoding:
Text File  |  1991-04-30  |  917 b   |  37 lines

  1. /*
  2.    Listing 6.14 STATIC Functions and ACHOICE()
  3.    Author: Greg Lief
  4.    Excerpted from "Clipper 5: A Developer's Guide"
  5.    Copyright (c) 1991 M&T Books
  6.                       501 Galveston Drive
  7.                       Redwood City, CA 94063-4728
  8.                       (415) 366-3600
  9. */
  10.  
  11. //───── NOTE: must compile with the /N option!
  12.  
  13. #include "inkey.ch"
  14.  
  15. function main 
  16. local marray := {'one', 'two', 'three'}, ele 
  17. cls 
  18. ele := achoice(11, 38, 13, 42, marray, .t., 'MyFunc') 
  19. return nil
  20.  
  21. //───── this function will not be recognized until you remove
  22. //───── the STATIC declaration
  23. static function myfunc(status, curr_elem, curr_row) 
  24. local key := lastkey() 
  25. if key == K_ESC
  26.    return 0 
  27. elseif key == K_ENTER
  28.    return 1 
  29. elseif key == 32
  30.    @ 20,0 say "You pressed Spacebar! Boy am I smart!" 
  31.    inkey(0) 
  32.    scroll(20, 0, 20, 36, 0) 
  33. endif 
  34. return 2
  35.  
  36. // end of file CHP0614.PRG
  37.