home *** CD-ROM | disk | FTP | other *** search
- **********************************************************
- ** Switch! Demo Ver 2.0 *
- ** *
- ** Edited using a tab size of 4. *
- ** December 22, 1988 *
- ** Copyright (C)1988, Curtis Little *
- **********************************************************
-
- CLEAR
- TEXT
- This demo demonstrates the usefullness of Switch!. Switch! is a
- Clipper function that frees up as much memory as needed to run
- another program. Switch! saves the memory used by your Clipper
- application to a temporary disk file (registered versions of
- Switch! use EMS if present) then frees it up for use by DOS. It
- can free up all but about 8K of available memory!! To see how
- helpful Switch! is this program allows you to specify a program
- to run and the amount of memory required by the program. Use a
- map program or CHKDSK to see how much memory you have free before
- running this demo. Then specify CHKDSK as the program to run from
- within this demo and specify 0 for the amount of memory required
- (a value of 0 causes Switch! to free all memory possible). You'll
- be amazed how much memory becomes available!
-
- Switch! was designed to work with ANY Clipper Summer '87 program.
- It doesn't matter how big the program is! You can free most of the
- used memory to run another program! Using Switch! you can run a
- 630K program from within a 640K program by using a simple function
- call. With Switch! there's no more worries about memory!
-
- The syntax for calling Switch! is:
-
- SWITCH87(Drive to use, K mem needed, Program to run and parameters)
-
- Pretty easy huh?
- ENDTEXT
- SET CURSOR OFF
- INKEY(0)
- SET CURSOR ON
- mprog = SPACE(127)
- mmem = 0
-
- DO WHILE .T.
- CLEAR
- @ 10, 0 SAY "Enter the program to run (leave blank for DOS shell):" GET mprog PICTURE '@s20'
- @ 12, 0 SAY " Enter amount of RAM required by program (0 for all):" GET mmem PICTURE "999" RANGE 0, 640
- READ
-
- ** Did the user escape out??
- IF LASTKEY() = 27
- EXIT
- ENDIF
-
- ** Execute the specified program using the default drive to save mem
- SWITCH87(0,mmem, trim(ltrim(mprog)))
- @ 0,0 CLEAR TO 5,79
- @ 2,0 SAY ""
- WAIT
- ENDDO
-
- CLEAR
- TEXT
-
- Switch! only frees up the memory it needs to. For instance, if you
- specify the program to run needs 64K Switch! will only save memory
- if there isn't already 64K free memory. Setting the value to the
- minimum required by the application reduces the time it takes to
- Switch! applications. To really get a feel for what Switch! can do
- for you use the SWITCH87.OBJ file to link Switch! into your own
- applications and use it to call other programs.
-
- To register Switch! (and get the source!) please send $20.00 check
- or money order to:
-
- Curtis Little
- 1087 Murrietta Blvd #244
- Livermore, CA 94550
-
-
-
-
-
-
- ENDTEXT
- RETURN
-
-