home *** CD-ROM | disk | FTP | other *** search
- Disk-Based BlackBoxes written in QuickBasic act somewhat like overlaid
- files, and can be used to incorporate special, stand-alone functions
- into LAYOUT FlowCharts.
-
- Because a Disk-Based Blackbox is basically a normal, self-contained
- executable program, the stand-alone code you write in QuickBasic needs
- only to follow a few simple rules to be converted.
-
- 1. Any memory which is allocated by the disk-based blackbox MUST be
- deallocated before exiting the program.
-
- 2. Any File Handles which are opened must be closed before exiting the
- program.
-
- 3. The Disk-Based BlackBox CANNOT leave the screen in text mode before
- exiting, and it should preserve the top two lines of the screen in
- case a menu is present from the calling procedure.
-
- 4. The Interrupt vectors 0F3H and 0F4H cannot be replaced.
-
- 5. The program must exit normally, it cannot terminate and stay resident.
-
- 6. Text Variables in QuickBasic are not in a recognizeable format to C,
- Pascal, or LAYOUT programs. When using them as parameters, it is
- strongly recommended that you create fixed-length text variables to
- use as parameters for you BlackBox.
-
-
- The procedure for calling a disk-based blackbox is as follows:
-
- 1. The parameters are pushed on the stack as if calling a memory-based
- blackbox. Note that the last parameter pushed will always be the
- LANGUAGE_TYPE integer value.
-
- 2. The value of the stack pointer and stack segment is stored in the
- graphics device driver using int 0F3H
-
- 3. An EXEC call (DOS CALL 21H, subfunction 4BH) is made to load and
- execute the disk-based blackbox.
-
- 4. Your Disk-Based BlackBox makes a call to int 0F3H to obtain the
- stored pointer to the passed data.
-
- 5. Whatever action required is performed.
-
- 6. Return whatever status values using the pointers passed.
-
- 6. Your Disk-Based BlackBox exits normally, after having deallocated any
- allocated memory and closing any file handles.
-
- 7. The calling program continues execution.
-
-
- Because BASIC does not contain a pointer structure, you must make a call
- to fill the parameters at the start of your program, and then make another
- to return any parameters at the end of your program. Both procedures
- are called using the CALLS command. The file BBX_INC.BAS holds the
- declarations for these calls, as well as the constant values to be used
- when describing parameters. Remember to include this file in your
- BlackBox!
-
-
- The call to fill parameters is GET.BLACKBOX.PARAMETERS. It takes an
- integer indicating the number of parameters passed to this BlackBox. Note
- that this INCLUDES the LANGUAGE_TYPE integer passed automatically to all
- BlackBoxes. It is then followed by the blackboxes parameters in the
- REVERSE order that the BlackBox requests them. Since the Language_Type
- is always the last parameter passed, it must be the first parameter
- described in GET.BLACKBOX.PARAMETERS. Each parameter requested starts with
- an integer indicating the type of the parameter, and then the actual name
- of the blackbox's variable to hold that parameter.
-
- To describe a parameter, use the appropriate constant for that parameter
- plus the "InputOnly" flag if necessary.
-
- For a BlackBox that requests the following 5 parameters in the following order:
-
- CHECK.BOX.FLAGS (A Check Box -- Input Value Only)
- NUMBER.TO.USE (An Integer -- Input Value Only)
- NUMBER.TO RETURN (An Integer -- Input/Output Variable)
- TEXT.VARIABLE (Text -- Input/Output Variable)
- RETURN CHECK BOX (A Check Box -- Output Variable)
-
- The Get.BlackBox.Parameters call would look like this:
-
- CALLS Get.BlackBox.Parameters (6, LayoutInteger+InputOnly, LanguageType, _
- LayoutCheckBox, Return.Check.Box, _
- LayoutText, Text.Variable, _
- LayoutInteger, Number.To.Return, _
- LayoutInteger+InputOnly, Number.To.Use, _
- LayoutCheckBox+InputOnly, Check.Box.Flags)
-
- Note that even though only 5 parameters are requested, the 6th, LanguageType
- is included in the parameter list as if it were asked for last. This parameter
- will ALWAYS be described as LayoutInteger+InputOnly!!!
-
-
- To return parameters from the BlackBox, call SET.BLACKBOX.PARAMETERS with
- exactly the same parameters passed to GET.BLACKBOX.PARAMETERS.
-
-
- In addition to including the file BBX_INC.BAS, you must also link the
- object module BBXPTR_B.OBJ into your program. This is the module that
- contains the two parameter calls.