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

  1. /*
  2.    Listing 6.8 Scope of STATIC 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. static y := "testing"
  15. local x
  16. for x := 1 to 100 
  17.    ? myfunc() 
  18.    ? y                // "testing"
  19. next 
  20. return nil 
  21.  
  22.  
  23. function myfunc 
  24. static y := 100 
  25. return --y 
  26.  
  27. // end of file CHP0608.PRG
  28.