home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 5 / 05.iso / a / a012 / 1.ddi / CHAP26.EXE / CHP2613.PRG < prev    next >
Encoding:
Text File  |  1991-04-30  |  1.2 KB  |  44 lines

  1. /*
  2.    Listing 29.13 Creating GET objects
  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. //───── this is common to all three examples
  14.  
  15. function main
  16. local x := space(20), theget
  17.  
  18.  
  19. //───── first example: GETNEW with all applicable parameters
  20. theget := getnew(20, 10, { | val | IF(PCOUNT() > 0, ;
  21.                  x := val, x) }, "x", "@!", "N/BG, +W/BG")
  22. readmodal( {theget} )   // must be passed as an array!
  23.  
  24.  
  25. //───── next example: GETNEW with no parameters - this also
  26. //───── reinforces the relationship between the parameters
  27. //───── shown above and the instance variables.
  28. theget := getnew()
  29. theget:row := 20
  30. theget:col := 10
  31. theget:block := { | val | IF(PCOUNT() > 0, x := val, x) }
  32. theget:name := "x"
  33. theget:picture := "@!"
  34. theget:colorSpec := "N/BG, +W/BG"
  35. readmodal( {theget} )  // again, must be passed as an array!
  36.  
  37.  
  38. //───── third example: @..GET
  39. @ 20, 10 get x picture '@!' color "N/BG, +W/BG"
  40. read
  41. return nil
  42.  
  43. // end of file CHP2613.PRG
  44.