home *** CD-ROM | disk | FTP | other *** search
- /*
- Listing 6.7 STATIC Variable Retaining Value
- 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 /N option!
-
- function main
- local x
- for x := 1 to 1000
- ? counter()
- next
- return nil
-
- function counter
- static y := 1
- return y++
-
- // end of file CHP0607.PRG
-