home *** CD-ROM | disk | FTP | other *** search
- {$A-,B-,E-,F+,I+,L+,N-,O+,R-,S+,V-}
- {$M 16384,0,655360} { !!Maximum Stack Allocation!! }
- { If your disk cannot hold a }
- { swap file of this size reduce }
- { the stack allocation accordingly }
-
- program HeapSwapDemo;
-
- uses crt,dos,
- _Heapswp,
- _DEMO;
-
- var S : string;
- R : real;
-
- begin
- clrscr;
- Show('^First make a background',3);
- background;
- delay(1000);
- Show('^Then put a box on it saving the|^background behind it to the Heap',5);
- MakeABox;
- delay(2000);
- Show('^Then show a Menu saving the|^background behind it to the Heap',5);
- if DoAMenu=1 then
- begin
- delay(1000);
- Show('^Now Push the whole screen|^to the Heap and Clear the Screen',5);
- PushAScreen;
- clrscr;
- Show('^OK off to DOS we go|^Type EXIT at the DOS prompt to get back here',3);
- R:=HeapSize;
- R:=R*16;
- str(R:8:0,S);
- Show('^Saving '+S+' bytes of Heap space',3);
- if PutHeap('.',0) then
- begin
- SwapVectors;
- exec(GetEnv('COMSPEC'),'');
- SwapVectors;
- GetHeap;
- end;
- Show('^We''re Back|^so Pop the Screen from the Heap',5);
- PopAScreen;
- delay(1000);
- Show('^Got our Screen Back so put away the Menu',4);
- closeBox;
- delay(1000);
- Show('^Get Rid of the Box',4);
- CloseBox;
- delay(1000);
- end;
- Show('^'^A' Have a nice day '^A,5);
- textmode(Lastmode);
- end.