home *** CD-ROM | disk | FTP | other *** search
/ World of Shareware - Software Farm 2 / wosw_2.zip / wosw_2 / QBAS / QB45MULT.ZIP / QBMULT.DOC < prev    next >
Text File  |  1993-10-03  |  9KB  |  193 lines

  1.  
  2.  
  3.      QB 4.5 Multi-tasking library. Version 1.0
  4.  
  5.      This library will allow you to produce Multitasking basic programs 
  6. using QB 4.5 basic system from MicroSoft.
  7.  
  8.      Included in this package are the following files.
  9.  
  10.      QBMULT.DOC   -  Getting started text file.
  11.      QB45MULT.LIB -  The library that does the magic.
  12.      QB45MULT.BI    -  Include file for the library.
  13.      QBMKMULT.BAT    -  Batch file to compile and link your program.
  14.      SAMPMULT.BAS  -  Sample program. 
  15.      EXEHDR.EXE    -  Program to modify EXE headers to ask DOS for less 
  16. than the max amount of memory.
  17.      EXEHDR.DOC    - Doc file explaining how to use EXEHDR.               
  18.  
  19. ************************************************************************
  20.      Warning: While I have tested this software as best I could, I can not 
  21. foresee ever possibility that might come up! You use this software at your 
  22. own risk! 
  23.  
  24.      Primary testing was done under DOS 5.0.
  25.  
  26.      I will not be held respondsable for any damage done, in any way, by the
  27. use of this software.
  28. *************************************************************************
  29.  
  30.      Over View:
  31.      Programs written to use this software are constructed following a few 
  32. basic rules. There are three subs that MUST be in the program, and the 
  33. names MUST be unchanged. Any code in the sub BASICPROCEDURE will be multi 
  34. tasked with DOS. Code in BASICPROCEDURE2 will only be run when the hotkey 
  35. is pressed, and multi tasking is suspended while in the sub.
  36.  
  37.      You will have to edit the QBMKMULT.BAT file to reflect your programs 
  38. name, and maybe the paths. No QLB is included in the package. No calls to 
  39. basic from 'C' are allowed when working within QBX, so a QLB is pointless. 
  40. This will make your debugging a bit harder, but there are ways around that, 
  41. too.
  42.  
  43.      To get started, load up the sample program and take a look at how 
  44. it's done. Notice the #include at the top. This MUST be there! Forget this, 
  45. and you go nowhere fast.
  46.      
  47.      The main module is where you will want to do your variable setup and 
  48. type commands. With a TSR, it's important that you declare all variables 
  49. you can before going resident. This makes it easier to determine the amount 
  50. of memory you want the program to reserve for itself, before turning the 
  51. rest back to DOS.
  52.  
  53.      With QB 4.5, we have to modify the EXE files header to ask DOS for 
  54. less than all of available memory. I've included a program to do that. 
  55.  
  56.      Now, you need to determine the hotkey that will popup your one 
  57. procedure. When pressed, a sub in your program will be called. Once again, the 
  58. program SAMPMULT has some comments showing how it's done.
  59.      
  60.      All that remains in the main module is to call 'GoMult'.
  61. It takes one perimiter, which you can use to load and NOT go resident if 
  62. you like. A value of zero will load as a TSR. A value of one will load and 
  63. run procedure one without going resident. 
  64.  
  65.      The program will never come back from GoMult if the load went ok.
  66. It will come back if a value of one is used.
  67.  
  68.      From there on, your resident and running in the background.
  69.  
  70.      The sub 'BasicStartup' will be called once, and only once, when the 
  71. program has been installed. As this is called after the system is 
  72. installed, you can be pretty sure you really ARE resident if you make it 
  73. this far. For this reason I like to use this to print a line or two 
  74. telling the user we are resident.
  75.  
  76.      The sub 'BasicProcedure' will be run in the background. This is where 
  77. you should put your code. If you declare all your variables shared in the 
  78. main module, they will be available as they always were. You can do some 
  79. dynamic variable allocation here, as long as most stay in DGROUP. See your 
  80. manual. Far strings are ok, but rather defeat the concept of a TSR.
  81.  
  82.      The sub 'BasicProcedure2' is called when your hotkey is pressed. All 
  83. multitasking will be suspended while in this sub. I use it as an exit 
  84. routine. You could of course use it for whatever you like. 
  85.  
  86.      The commands avaliable to you are listed below. Very little checking 
  87. is done to see that the values passed are valid, so keep an eye on it.
  88.  
  89.      GoMult (a%) -
  90.  Installs the TSR. a% can equal 0, 1, or 2.
  91.               Zero will install as a TSR.
  92.               One will not go TSR, and run basicprocedure.
  93.               Two will not go resident, and run basicprocedure2.
  94.  
  95.      Use a value of one or two when testing, or if running under another 
  96. multitasker.
  97.  
  98.      a%=checkinstalled - 
  99.  Checks to see if the program has been loaded before. You can still load it 
  100. again, but I see little point. It simply gives you an out if you want it.
  101.  
  102.      exitmult -
  103.  When called, it sets a flag indicating you wish to deinstall the TSR. You 
  104. must call it, and then exit the sub before it takes place. One other thing. 
  105. It will not uninstall if a program has been loaded after it to prevent 
  106. memory arena problems. You will have to exit the other program first, then 
  107. try again.
  108.  
  109.      sethotkeys (key%, keyflag%)
  110.  Sets the hotkey to use to pop up. It takes two values. The first is 
  111. the ascii code of the key, and the second is the scan code for ALT, CTL or 
  112. whatever. As a programer, you might be nice and use COMMAND$ to let the end 
  113. user pick these keys...
  114.  
  115.      yield-
  116.      Gives the rest of this timer tick back to the foreground task. Use of 
  117. this when you can will make the foreground task more responsive. 
  118. Recomend you use whenever and where ever you can! 
  119.      Do not use if you are not going resident! The sample program shows a 
  120. simple way around it.
  121.  
  122.      That concludes the list of commands. Not much to it, is there? The 
  123. idea is to let the programmer produce TSR's without a lot of hassle. I 
  124. think I have done that. Heck, let me know what YOU think!
  125.  
  126. **************************************************************************
  127.      Random thoughts, misc blatherings...
  128.  
  129.      Try to keep the memory used as low as you can. While this is not easy 
  130. in PDS, it's still a worthly goal.
  131.  
  132.      Third party librarys should work ok when used with PDSMULT. I'm real 
  133. interested in finding which do and which do not. You might consider 
  134. dropping me a card letting me know what you discover.
  135.  
  136.      For that matter, I wonder what size EXE we would get if we combine PDQ 
  137. or QBTINY with PDSMULT? Hmmmm...
  138.  
  139.      The method used to see if it's already been loaded is not fool proof. 
  140. It has the little bug that it will think ANY program loaded using this 
  141. library is itself. I'm working on that, but thats why I let you go ahead 
  142. and load it if you like...
  143.  
  144.      This is version one. I want, nay, I NEED your input for version two! 
  145. It costs very little really to call and tell me your ideas. I have a LOT of 
  146. ideas, as I'm sure you have, of changes that can and should be made. Let me 
  147. know!
  148.  
  149.      This version is really a demo. I included a screen that pops up when 
  150. you run the program. Sorry, but I have 12 other shareware programs out 
  151. there, and the only registrations are in the ones I limited in some way. 
  152. That screen is of course removed in the normal version.
  153.  
  154.      The shell command can not be used. Once you go resident, it's a pain 
  155. to allocate memory again. I'm looking at ways around this....
  156.  
  157.      Inkey$: Well, it works, but not very well. You can hardly tell which 
  158. task will get the keystroke. The result is not very pretty.
  159.  
  160.      Some times things will not work correctly once resident. An example 
  161. was a test program I wrote that did file I/O. It crashed every time on the 
  162. OPEN command. I finally figured out it was the file number holding things 
  163. up. I got it up and running by changing 'OPEN "TEST.FIL" FOR RANDOM AS #1' 
  164. to 'NEXTFREEFILE% = FREEFILE: OPEN "TEST.FIL FOR RANDOM AS #NEXTFREEFILE%'
  165.      Viola!  It works. I point this out so you will be aware that you may 
  166. have to look at a problem from a slant sometimes.
  167.  
  168.  
  169. **************************************************************************
  170.  
  171.      Support:
  172.  
  173.      I can provide support for this LIB my mail or by a voice phone call. 
  174. Mail is preferred if it's nothing you need TODAY. Also, I respond to 
  175. registered users before any others.
  176.      If you have to, call voice evenings. Please keep in mind the time 
  177. zones!
  178.  
  179.      The price for QB45MULT is $49.00. Send a check to the address below, and
  180. I'll mail out your copy on 5 1/4 floppy the next day.
  181.  
  182.      All orders will be shipped on 360k 5 1/4 floppy.
  183.  
  184.      This price is good until 01/01/94. After that, please call.
  185.  
  186.  
  187.                                               Doug Miller
  188.                                               11765 CR 50.
  189.                                               Ligonier, IN. 46767
  190.                                               Voice#219-894-4024
  191.  
  192.                                              
  193.