home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 15 / 15.iso / s / s087 / 2.img / BASIC5.ARC / BBX_BAS.DOC next >
Encoding:
Text File  |  1989-12-20  |  4.4 KB  |  105 lines

  1. Disk-Based BlackBoxes written in QuickBasic act somewhat like overlaid
  2. files, and can be used to incorporate special, stand-alone functions
  3. into LAYOUT FlowCharts.
  4.  
  5. Because a Disk-Based Blackbox is basically a normal, self-contained
  6. executable program, the stand-alone code you write in QuickBasic needs
  7. only to follow a few simple rules to be converted.
  8.  
  9. 1.  Any memory which is allocated by the disk-based blackbox MUST be
  10.     deallocated before exiting the program.
  11.  
  12. 2.  Any File Handles which are opened must be closed before exiting the
  13.     program.
  14.  
  15. 3.  The Disk-Based BlackBox CANNOT leave the screen in text mode before
  16.     exiting, and it should preserve the top two lines of the screen in
  17.     case a menu is present from the calling procedure.
  18.  
  19. 4.  The Interrupt vectors 0F3H and 0F4H cannot be replaced.
  20.  
  21. 5.  The program must exit normally, it cannot terminate and stay resident.
  22.  
  23. 6.  Text Variables in QuickBasic are not in a recognizeable format to C,
  24.     Pascal, or LAYOUT programs.  When using them as parameters, it is
  25.     strongly recommended that you create fixed-length text variables to
  26.     use as parameters for you BlackBox.
  27.  
  28.  
  29. The procedure for calling a disk-based blackbox is as follows:
  30.  
  31. 1.  The parameters are pushed on the stack as if calling a memory-based
  32.     blackbox.  Note that the last parameter pushed will always be the
  33.     LANGUAGE_TYPE integer value.
  34.  
  35. 2.  The value of the stack pointer and stack segment is stored in the
  36.     graphics device driver using int 0F3H
  37.  
  38. 3.  An EXEC call (DOS CALL 21H, subfunction 4BH) is made to load and
  39.     execute the disk-based blackbox.
  40.  
  41. 4.  Your Disk-Based BlackBox makes a call to int 0F3H to obtain the
  42.     stored pointer to the passed data.
  43.  
  44. 5.  Whatever action required is performed.
  45.  
  46. 6.  Return whatever status values using the pointers passed.
  47.  
  48. 6.  Your Disk-Based BlackBox exits normally, after having deallocated any
  49.     allocated memory and closing any file handles.
  50.  
  51. 7.  The calling program continues execution.
  52.  
  53.  
  54. Because BASIC does not contain a pointer structure, you must make a call
  55. to fill the parameters at the start of your program, and then make another
  56. to return any parameters at the end of your program.  Both procedures
  57. are called using the CALLS command.  The file BBX_INC.BAS  holds the
  58. declarations for these calls, as well as the constant values to be used
  59. when describing parameters.  Remember to include this file in your
  60. BlackBox!
  61.  
  62.  
  63. The call to fill parameters is GET.BLACKBOX.PARAMETERS.  It takes an
  64. integer indicating the number of parameters passed to this BlackBox.   Note
  65. that this INCLUDES the LANGUAGE_TYPE integer passed automatically to all
  66. BlackBoxes.  It is then followed by the blackboxes parameters in the
  67. REVERSE order that the BlackBox requests them.    Since the Language_Type
  68. is always the last parameter passed, it must be the first parameter
  69. described in GET.BLACKBOX.PARAMETERS.  Each parameter requested starts with
  70. an integer indicating the type of the parameter, and then the actual name
  71. of the blackbox's variable to hold that parameter.
  72.  
  73. To describe a parameter, use the appropriate constant for that parameter
  74. plus the "InputOnly" flag if necessary.
  75.  
  76. For a BlackBox that requests the following 5 parameters in the following order:
  77.  
  78.      CHECK.BOX.FLAGS (A Check Box -- Input Value Only)
  79.      NUMBER.TO.USE (An Integer -- Input Value Only)
  80.      NUMBER.TO RETURN (An Integer -- Input/Output Variable)
  81.      TEXT.VARIABLE (Text -- Input/Output Variable)
  82.      RETURN CHECK BOX (A Check Box -- Output Variable)
  83.  
  84. The Get.BlackBox.Parameters call would look like this:
  85.  
  86.     CALLS Get.BlackBox.Parameters (6, LayoutInteger+InputOnly, LanguageType, _
  87.                  LayoutCheckBox, Return.Check.Box, _
  88.                  LayoutText, Text.Variable, _
  89.                  LayoutInteger, Number.To.Return, _
  90.                  LayoutInteger+InputOnly, Number.To.Use, _
  91.                  LayoutCheckBox+InputOnly, Check.Box.Flags)
  92.  
  93. Note that even though only 5 parameters are requested, the 6th, LanguageType
  94. is included in the parameter list as if it were asked for last.  This parameter
  95. will ALWAYS be described as LayoutInteger+InputOnly!!!
  96.  
  97.  
  98. To return parameters from the BlackBox, call SET.BLACKBOX.PARAMETERS with
  99. exactly the same parameters passed to GET.BLACKBOX.PARAMETERS.
  100.  
  101.  
  102. In addition to including the file BBX_INC.BAS, you must also link the
  103. object module BBXPTR_B.OBJ into your program.  This is the module that
  104. contains the two parameter calls.
  105.