home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 5 / 05.iso / a / a012 / 1.ddi / CHAP06.EXE / CHP0604.PRG < prev    next >
Encoding:
Text File  |  1991-04-30  |  912 b   |  40 lines

  1. /*
  2.    Listing 6.4 Scope of PUBLIC Variables
  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 /N option!
  12.  
  13. function main
  14. myfunc1() 
  15. ? mvar       // 416          will get compiler warning here
  16. ? marray[1]  // NIL          will get compiler warning here
  17. return nil
  18.  
  19.  
  20. function myfunc1 
  21. public mvar := 200 
  22. myfunc2() 
  23. ? mvar        // 416 
  24. ? marray[1]   // NIL         will get compiler warning here
  25. return nil 
  26.  
  27.  
  28. function myfunc2 
  29. mvar *= 2                    // will get compiler warning here
  30. myfunc3() 
  31. return nil 
  32.  
  33.  
  34. function myfunc3 
  35. public marray[10] 
  36. mvar += 16                   // will get compiler warning here
  37. return nil
  38.  
  39. // end of file CHP0604.PRG
  40.