How to Make a Custom Run-time Module from UI Toolbox (82877)



The information in this article applies to:

  • Microsoft Basic Professional Development System for MS-DOS 7.1
  • Microsoft Basic Professional Development System for MS-DOS 7.0

This article was previously published under Q82877

SUMMARY

It is beneficial to make a custom run-time module out of the Basic PDS User Interface (UI) Toolbox routines when using more than one program that uses these routines. This will save disk space and increase speed when chaining to other programs, because the run-time module will stay in memory across a CHAIN. This article describes the process of creating a custom run-time module out of the User Interface Toolbox routines.

MORE INFORMATION

First, note that you shouldn't put assembly routines that reference DGROUP in a custom run-time that will be used in a CHAINed program. UIASM.OBJ routines reference DGROUP. To work around this limitation, add the line "DGROUP Assumes DS" to the top of UIASM.ASM (provided with Basic PDS) and re-assemble it into a new UIASM.OBJ. (Another workaround is to use the value of SS in your assembler routine instead of DGROUP, because Basic always assumes that SS coincides with DGROUP.)

See also page 668 under "DGROUP References" in the "Microsoft Basic 7.0: Programmer's Guide" for Microsoft Basic PDS versions 7.0 and 7.1.

The Basic run-time module can be extended with the BUILDRTM.EXE utility. A Basic program must be compiled WITHOUT the /O (standalone) option to use the run-time or extended run-time module.

To create a custom run-time module, do the following:

  1. You must first create an "export list" containing all the subroutine and function names that will be used in the custom run-time module.

    To create the export list, use a text editor to type the following into a file, and save it under the name EXPORT.LST (any name will suffice):
    #
    # The names of all the routines used in the User Interface Toolbox,
    # which can be found in MENU.BI, MOUSE.BI, GENERAL.BI, and WINDOW.BI.
    #
    #EXPORTS
    MenuItemToggle
    MenuInit
    MenuColor
    MenuSet
    MenuShow
    MenuPreProcess
    MenuEvent
    MenuInkey
    MenuDo
    MenuCheck
    MenuOn
    MenuOff
    ShortCutKeySet
    ShortCutKeyDelete
    ShortCutKeyEvent
    MenuSetState
    MouseHide
    MouseShow
    MousePoll
    MouseBorder
    MouseDriver
    MouseInit
    ButtonSetState
    WindowDo
    ButtonOpen
    WindowLine
    WindowPrint
    WindowOpen
    ButtonClose
    WindowClose
    WindowShadowSave
    WindowShadowRefresh
    WindowPrintTitle
    ButtonShow
    WindowSave
    WindowRefresh
    BackgroundSave
    BackgroundRefresh
    ListBox
    MaxScrollLength
    WindowCurrent
    WindowBorder
    WindowCols
    WindowRows
    Alert
    Dialog
    ButtonInquire
    WindowNext
    FindButton
    WindowScroll
    EditFieldInquire
    FindEditField
    EditFieldClose
    ButtonToggle
    EditFieldOpen
    WindowBox
    WindowCls
    WindowColor
    WindowInit
    WindowLocate
    WindowSetCurrent
    WhichWindow
    Interrupt
    GetCopyBox
    PutCopyBox
    AttrBox
    PutBackground
    GetBackground
    Box
    Scroll
    GetShiftState
    AltToASCII
    #
    # This is where you list the library that contains all the
    # routines listed above
    #
    #LIBRARIES
    UITBEFR.LIB
    						
  2. After saving the EXPORT.LST file, run the following BUILDRTM command at the command prompt. Note that the only option needed is /Fs; the rest are defaults. UITBRUN is the name of the new custom run-time library.
          BUILDRTM /FPi /LR /Fs UITBRUN EXPORT.LST
    						
    This command will create an object file named IMPORT.OBJ that must be linked with your final program.
  3. You will now have the custom run-time library. The next and final step is linking your program together. The following will compile and link the UIDEMO (UIDEMO.BAS is included with PDS) sample program with your newly created custom run-time library.
          BC /X /FS UIDEMO.BAS;
          LINK IMPORT.OBJ+UIDEMO.OBJ,UIDEMO.EXE,,UITBRUN;
    						
    (NOTE: The IMPORT.OBJ module must be first on the link line.)
  4. To run the program, type UIDEMO at the command prompt.

Modification Type:MinorLast Reviewed:8/16/2005
Keywords:KB82877