home *** CD-ROM | disk | FTP | other *** search
- /*
- Listing 6.9 Precedence of STATIC Variables
- 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!
-
- function main
- private mvar := 5
- myfunc()
- ? mvar // still 5
- return nil
-
-
- function myfunc
- static mvar := 1
- ? mvar // 1, not 5
- return nil
-
- // end of file CHP0609.PRG
-