home *** CD-ROM | disk | FTP | other *** search
- /*
- Listing 29.13 Creating GET objects
- Author: Greg Lief
- Excerpted from "Clipper 5: A Developer's Guide"
- Copyright (c) 1991 M&T Books
- 501 Galveston Drive
- Redwood City, CA 94063-4728
- (415) 366-3600
- */
-
- //───── NOTE: must compile with the /N option!
-
- //───── this is common to all three examples
-
- function main
- local x := space(20), theget
-
-
- //───── first example: GETNEW with all applicable parameters
- theget := getnew(20, 10, { | val | IF(PCOUNT() > 0, ;
- x := val, x) }, "x", "@!", "N/BG, +W/BG")
- readmodal( {theget} ) // must be passed as an array!
-
-
- //───── next example: GETNEW with no parameters - this also
- //───── reinforces the relationship between the parameters
- //───── shown above and the instance variables.
- theget := getnew()
- theget:row := 20
- theget:col := 10
- theget:block := { | val | IF(PCOUNT() > 0, x := val, x) }
- theget:name := "x"
- theget:picture := "@!"
- theget:colorSpec := "N/BG, +W/BG"
- readmodal( {theget} ) // again, must be passed as an array!
-
-
- //───── third example: @..GET
- @ 20, 10 get x picture '@!' color "N/BG, +W/BG"
- read
- return nil
-
- // end of file CHP2613.PRG
-