home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / INFO / PGMUTL / SWITCH22.ZIP / SWDEMO.PRG < prev    next >
Encoding:
Text File  |  1989-01-22  |  3.0 KB  |  88 lines

  1. **********************************************************
  2. **    Switch! Demo Ver 2.0                                 *
  3. **                                                         *
  4. **    Edited using a tab size of 4.                         *
  5. **    December 22, 1988                                     *
  6. **    Copyright (C)1988, Curtis Little                     *
  7. **********************************************************
  8.  
  9. CLEAR
  10. TEXT
  11.      This demo demonstrates the usefullness of Switch!.  Switch! is a 
  12.      Clipper function that frees up as much memory as needed to run
  13.      another program.  Switch! saves the memory used by your Clipper
  14.      application to a temporary disk file (registered versions of 
  15.      Switch! use EMS if present) then frees it up for use by DOS. It
  16.      can free up all but about 8K of available memory!!  To see how
  17.      helpful Switch! is this program allows you to specify a program 
  18.      to run and the amount of memory required by the program.  Use a 
  19.      map program or CHKDSK to see how much memory you have free before 
  20.      running this demo.  Then specify CHKDSK as the program to run from 
  21.      within this demo and specify 0 for the amount of memory required 
  22.      (a value of 0 causes Switch! to free all memory possible).  You'll 
  23.      be amazed how much memory becomes available!
  24.      
  25.      Switch! was designed to work with ANY Clipper Summer '87 program.  
  26.      It doesn't matter how big the program is!  You can free most of the 
  27.      used memory to run another program!  Using Switch! you can run a 
  28.      630K program from within a 640K program by using a simple function 
  29.      call.  With Switch! there's no more worries about memory!
  30.  
  31.      The syntax for calling Switch! is:
  32.    
  33.      SWITCH87(Drive to use, K mem needed, Program to run and parameters)
  34.  
  35.      Pretty easy huh?        
  36. ENDTEXT
  37. SET CURSOR OFF
  38. INKEY(0)
  39. SET CURSOR ON
  40. mprog = SPACE(127)
  41. mmem = 0
  42.  
  43. DO WHILE .T.
  44.   CLEAR
  45.   @ 10, 0 SAY "Enter the program to run (leave blank for DOS shell):" GET mprog PICTURE '@s20'
  46.   @ 12, 0 SAY " Enter amount of RAM required by program (0 for all):" GET mmem PICTURE "999" RANGE 0, 640
  47.   READ
  48.  
  49.   ** Did the user escape out??
  50.   IF LASTKEY() = 27
  51.     EXIT
  52.   ENDIF
  53.  
  54.   ** Execute the specified program using the default drive to save mem
  55.   SWITCH87(0,mmem, trim(ltrim(mprog)))
  56.   @ 0,0 CLEAR TO 5,79
  57.   @ 2,0 SAY ""
  58.   WAIT
  59. ENDDO
  60.  
  61. CLEAR
  62. TEXT
  63.  
  64.      Switch! only frees up the memory it needs to.  For instance, if you
  65.      specify the program to run needs 64K Switch! will only save memory
  66.      if there isn't already 64K free memory.  Setting the value to the 
  67.      minimum required by the application reduces the time it takes to
  68.      Switch! applications.  To really get a feel for what Switch! can do 
  69.      for you use the SWITCH87.OBJ file to link Switch! into your own 
  70.      applications and use it to call other programs.
  71.  
  72.      To register Switch! (and get the source!) please send $20.00 check 
  73.      or money order to:
  74.       
  75.                       Curtis Little
  76.                       1087 Murrietta Blvd #244
  77.                       Livermore, CA  94550
  78.  
  79.  
  80.  
  81.  
  82.  
  83.  
  84. ENDTEXT
  85. RETURN
  86.  
  87.  
  88.