home *** CD-ROM | disk | FTP | other *** search
- /*
- Listing 18.10 SAVE/RESTORE RELATIONS
- Author: Joe Booth
- 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!
-
- STATIC rstack_:={}
-
- function save_rela
- Aadd( rstack_,{ dbrelation(1),dbrselect(1) } )
- return NIL
-
- function rest_rela
- LOCAL rsize:=len(rstack_)
- LOCAL r_exp,r_area,r_work
- if rsize > 0
- r_exp := rstack_[rsize,1]
- r_area := rstack_[rsize,2]
- r_work := alias(r_area)
- dbsetrelation(r_work,;
- &("{ || "+r_exp+"} "),r_exp)
- Asize(rstack_,rsize-1)
- endif
- return NIL
-
- // end of file CHP1810.PRG
-