home *** CD-ROM | disk | FTP | other *** search
- ''****************************************************************************
- '
- ' Blinker 2.00 swap function demo
- '
- ' MS PDS 7.1 example
- '
- ' Compile: BC swapdemo /O;
- '
- '****************************************************************************
- '
- ' $INCLUDE: 'blinker.bi'
- '
- enable = 1
- disable = 0
-
- print "Basic Swap example"
- print "=================="
- print
- print "Swap defaults "
- print
- print "Use EMS memory : ",SWPUSEEMS%(disable)
- print "Use XMS memory : ",SWPUSEXMS%(disable)
- print "Use UMBs : ",SWPUSEUMB%(disable)
- print "Save/restore video mode : ",SWPVIDMDE%(disable)
- print "Save/restore directory : ",SWPCURDIR%(disable)
- print "Display message : ",SWPDISMSG%(disable)
- print "Wait for keypress : ",SWPGETKEY%(disable)
- print "Suppress <Ctrl><Alt><Del> : ",SWPNOBOOT%(disable)
- print
-
- print "Program already running? : ",SWPGETPIDBAS%("swapdemo.bas")
- print "Set program ID to swapdemo.bas : ",SWPSETPIDBAS%("swapdemo.bas")
- print
-
- ' enable ems / xms / umbs
-
- i = SWPUSEEMS%(enable)
- i = SWPUSEXMS%(enable)
- i = SWPUSEUMB%(enable)
-
- ' save / restore current directory and video mode
- ' video buffer contents are not saved
-
- i = SWPCURDIR%(enable)
- i = SWPVIDMDE%(enable)
-
- if SWPGETPIDBAS%("swapdemo.bas") = 0 THEN
- ' if we're not running already
- print "Shelling to DOS..."
- print "Run swapdemo again to see SWPGETPIDBAS()."
- print "-------------------------------------------------------------------------"
-
- ' status = bliswprunbas(ChildProg, Memory, Shell Directory, Temporary directory)
-
- i = SWPRUNCMDBAS%( "", 0, "", "")
-
- print "-------------------------------------------------------------------------"
- print "Back from shell, status is : ",i
-
- i = SWPERRMAJ%
-
- ' get major error code
-
- print "Major error code : ",i;" ";
-
- SELECT CASE i
- CASE SWPNONERR
- print "(no error)"
- CASE SWPFULERR
- print "(disk full error)"
- CASE SWPDSKERR
- print "(disk error)"
- CASE SWPDIRERR
- print "(change directory error)"
- CASE SWPCREERR
- print "(create file error)"
- CASE SWPDRVERR
- print "(change drive error)"
- CASE SWPEMSERR
- print "(EMS error)"
- CASE SWPXMSERR
- print "(XMS error)"
- CASE SWPCMDERR
- print "(SHELL error)"
- CASE SWPHANERR
- print "(handle table too large error)"
- CASE SWPMEMERR
- print "(top of memory address changed)"
- CASE SWPMCBERR
- print "(corrupt memory chain error)"
- CASE ELSE
- print "(unknown error)"
- END SELECT
-
- print "Minor error code : ",SWPERRMIN%
- print "Child process return code was : ",BLISWPRET%
-
- else
- ' we're already running, terminate the program
- print "Terminating (swapdemo.bas already executing)"
- print "Type EXIT to return to previous swapdemo.bas"
- endif
-
-