home *** CD-ROM | disk | FTP | other *** search
- /*
- Listing 6.4 Scope of PUBLIC 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 /N option!
-
- function main
- myfunc1()
- ? mvar // 416 will get compiler warning here
- ? marray[1] // NIL will get compiler warning here
- return nil
-
-
- function myfunc1
- public mvar := 200
- myfunc2()
- ? mvar // 416
- ? marray[1] // NIL will get compiler warning here
- return nil
-
-
- function myfunc2
- mvar *= 2 // will get compiler warning here
- myfunc3()
- return nil
-
-
- function myfunc3
- public marray[10]
- mvar += 16 // will get compiler warning here
- return nil
-
- // end of file CHP0604.PRG
-