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

  1. /*
  2.    Listing: 17.5  Env_stack()
  3.    Author: Joe Booth
  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 the /N option!
  12.  
  13. function Env_Stack(push)
  14. static setstack_:={}
  15. local i
  16. if push == nil
  17.    push := .T.
  18. endif
  19. if push
  20.    aadd(setstack_, SetArray())
  21. else
  22.    for i = 1 to len(setstack_[len(setstack_)])
  23.       set(i, setstack_[len(setstack_), i])
  24.    next i
  25.    asize(setstack_, len(setstack_) -1)
  26. endif
  27. return NIL
  28.  
  29.  
  30. function SetArray
  31. local i, s_ := {}
  32. for i = 1 to _SET_COUNT
  33.    Aadd(s_,set(i))
  34. next i
  35. return s_
  36.  
  37. // end of file CHP1705.PRG
  38.