home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / basic / tools / quicklin / l.doc < prev    next >
Text File  |  1991-11-22  |  23KB  |  490 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17.  
  18.  
  19.  
  20.  
  21.                                 The QuickBASIC
  22.  
  23.                           Compiler/Linker Assistant
  24.  
  25.                                  Version 1.2
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.    (C) Copyright 1991 by Robin Duffy and Sequential Software Incorporated
  35.                              All rights reserved.
  36.  
  37.             QuickBASIC is a registered trademark of Microsoft Inc.
  38.  
  39.  
  40.  
  41.  
  42.                      SECTION ONE: Introduction to L.EXE
  43.  
  44.     1.1 Program Overview
  45.  
  46.             L.EXE is a utility designed to help compile and link stand
  47.        alone programs from QuickBASIC 4.0+ source code. It operates much
  48.        like the compile options from within the environment but allows
  49.        total control over the compiling and linking process. After
  50.        setting the options YOU want, simply press one key and let L.EXE
  51.        do the work for you!
  52.  
  53.             Why compile and link away from QuickBASIC? Good question. By
  54.        compiling away from the environment you can create smaller
  55.        programs that execute faster. For example, if your program does
  56.        not require use of the COM port, the code is STILL ADDED anyway.
  57.        Linking your program with NOCOM.OBJ (as supplied with QB 4) will
  58.        eliminate the extra code - if you link from the command line.
  59.        Another good example of this is using ON ERROR. ON ERROR has two
  60.        different sets of code, but both are added even if you only use
  61.        one of them. By setting your own options you can eliminate a lot
  62.        of useless code and gain speed as a benefit.
  63.  
  64.             Compiling and linking from the DOS command line is fairly
  65.        simple if you are compiling only one module and linking with only
  66.        one library. Start adding modules and the process gets more
  67.        involved, fast. Worse yet, most "toolboxes" come as libraries you
  68.        must add, and there are stub files to add as well. Almost a hopeless
  69.        situation - until L.EXE.
  70.  
  71.             Tell L.EXE what compiler options you want. Set your own
  72.        link options as well. Specify three (or more) libraries and
  73.        throw in a couple of stub files to boot. Give it the name of your
  74.        source file and press a key. L.EXE will give all the necessary
  75.        commands to compile your source code. Multiple modules? No problem.
  76.        L.EXE will find your MAKE file and add the needed modules automatic-
  77.        ally. Compiling and linking away from the QB environment need not be
  78.        difficult - if you have the right tool.
  79.  
  80.     1.2 Requirements for L.EXE
  81.  
  82.             L.EXE requires DOS 3.0 or later and at least 256K system
  83.        memory in order to operate. You may use L.EXE with one disk
  84.        drive although a hard disk is strongly recommended for best
  85.        operation. This program is intended to be used with BC.EXE and
  86.        LINK.EXE as provided with QuickBASIC 4.0 + 4.5 and has not
  87.        been tested with other compilers.
  88.  
  89.             In addition to all this you will need your own source
  90.        files and your own libraries. L.EXE is meant as an interface
  91.        for QB only and does not provide the programs necessary for
  92.        compiling and linking source files. This is left up to you to
  93.        provide.                     
  94.  
  95.     1.3 Support Files for L.EXE
  96.  
  97.             During normal operation L.EXE uses and creates several files.
  98.        Listed below are some of these files and their respective notes.
  99.  
  100.             L.HLP - This file contains the help screens for L.EXE.
  101.             It should be placed in the same directory as L.EXE for
  102.             proper operation. L.EXE can function without this file but
  103.             help will not be available.
  104.  
  105.             *.LNK - These files are created by the program when you
  106.             push the F2 key (see "Program Operation" for more info).
  107.             These files are created in the directory where L.EXE is
  108.             located regardless of the current directory.
  109.  
  110.             BC.EXE - The QuickBASIC compiler program versions 4.0 or 4.5.
  111.             L.EXE has not been tested with earlier versions.
  112.  
  113.             LINK.EXE - As supplied with QuickBASIC.
  114.  
  115.             *.OBJ - These are the compiled source object files and stub
  116.             files. BC will create these in the current directory. Link will
  117.             then use these to create the finished program.
  118.  
  119.             *.LIB - The various library files. One is BCOM45.LIB, which
  120.             is used for stand-alone EXE files. Toolbox kits often come in
  121.             the form of libraries which can also be added.
  122.  
  123.             *.BAS - Your BASIC source files.
  124.  
  125.             *.MAK - If you use multiple modules QB will create a file
  126.             with a .MAK extension containing a list of all modules
  127.             included with your code. If it exists, L.EXE will read this
  128.             file and add the specified modules to your program
  129.             automatically.
  130.  
  131.             There is quite a bit to keep track of while compiling and
  132.        linking programs. You can see that without a utility such as
  133.        this, creating stand-alone programs can be a grueling process. L.EXE
  134.        can let you to benefit from separate compiling and linking while
  135.        shielding you from the rigors of such a process. The next section
  136.        tells you how.
  137.  
  138.                         SECTION TWO: Program Operation
  139.  
  140.     2.1 Getting Started
  141.  
  142.             To start the program type "L" (without quotes) from the DOS
  143.        prompt. This will start the program and display the main screen.
  144.        You may also use the command line switches to alter the operation of
  145.        the program. The command line options are:
  146.  
  147.                /Q - Select quiet mode. This will turn off the alarms
  148.                present in L.EXE. Please note this will not silence the
  149.                beeps given by BC.EXE should errors occur.
  150.  
  151.                /R Filename - will read a data file at start up. See the
  152.                section on multiple data files for more information.
  153.  
  154.                /C Filename - will compile a data file in batch mode. See
  155.                the section on command line operation for more information.
  156.  
  157.             The main screen is divided into three main sections of
  158.        information that you will need to enter. Some fields are optional
  159.        while others are required. To enter information just type it in. You
  160.        can use the up/down arrow keys to move from field to field. Please
  161.        note the text in the current field is in high intensity - this will
  162.        help distinguish the field you are in. While entering information
  163.        you may use the insert/del keys and the left/right arrows. Let's now
  164.        look at the top section of information.
  165.  
  166.             The top section consists of path information concerning your
  167.        computer set up. It is necessary for L.EXE to know where you
  168.        keep certain items. Please enter the path to your source file
  169.        directory, the directory where you keep BC and LINK, your library
  170.        directory, and where you keep stub files. When specifying paths the
  171.        drive parameter is optional. For hard disk use both of the following
  172.        examples are valid:
  173.                              c:\qb\basfiles
  174.                              \qb\library
  175.  
  176.             If you leave a path blank L.EXE will use the current directory.
  177.  
  178.             L.EXE is set up to allow maximum organization of your hard
  179.        disk. If you are using a one or two drive system please see the
  180.        sections dealing will those situations under "Compiling and
  181.        Linking Your Program" elsewhere in this text.
  182.  
  183.             The middle section is where you specify your options for BC
  184.        and LINK, what libraries you want to link with, and any stub files
  185.        you may want to add to your program. The options for BC and LINK are
  186.        in the form of command line switches. Specify these switches as
  187.        though you were giving them on the command line (ex: /o /s /t for
  188.        BC.EXE)
  189.  
  190.             There is one field for compiler options and two for link
  191.        options. There are 27 different options you can specify for LINK,
  192.        so the extra field has been added. You may use either of the link
  193.        option fields or a combination of both.
  194.  
  195.  
  196.             Next specify which libraries you wish to link with. Multiple
  197.        libraries can be specified by separating each library in this field
  198.        by a space. The libraries are presented to LINK in the order you
  199.        give them. Giving a path with a library will override the path given
  200.        in the top section.
  201.  
  202.             Stub files are any special purpose object files you may want to
  203.        add to your program. These are object files such as NOCOM.OBJ,
  204.        NOEM.OBJ, and SMALLERR.OBJ. By using object files such as these you
  205.        can dramatically shrink the size of your code. If you plan to use
  206.        multiple stub files be sure to separate each name in the field by a
  207.        space. Giving a path with a stub file will override the path given
  208.        in the top section.
  209.  
  210.             You can fit more names in each field by not giving an extension.
  211.        Extensions are not necessary for any of the information you enter.
  212.        L.EXE, BC, and LINK know what the extensions are and will add them
  213.        for you.
  214.  
  215.             The final section is where you tell L.EXE what source file
  216.        you wish to compile and the name you want to give it. The source
  217.        name field is designed to accept only ONE file name. If your program
  218.        consists of several separate modules QB will create a make file in
  219.        your source directory containing all the modules to your program.
  220.        L.EXE will read this file if it exists and add all the modules in
  221.        the make file to your program. The compiler options you specify will
  222.        be applied to all modules so they  are all compiled the same.
  223.        Consult your QB manual for more information about .MAK files.
  224.  
  225.             In the last field place the name you wish to give your
  226.        program. If left blank the name will default to the same name as your
  227.        source file. The extension .EXE is assumed. You may also enter a path
  228.        to create the file in a different directory.
  229.  
  230.     2.2 Multiple Data Files
  231.  
  232.             L.EXE can save the information you have entered into a data
  233.        file. You may store a virtually unlimited number of different data
  234.        files. After entering data press the F2 key. L.EXE will save the
  235.        data into a file with the same name as your source file with the
  236.        extension of ".LNK" in the same directory as L.EXE. You may then
  237.        load this file at any time if you desire to recompile your program.
  238.        If the source data field is blank, the program will create a data
  239.        file called LINKER.LNK (the default data file).
  240.  
  241.             You can load a data file into the program in one of two ways.
  242.        You may read a data file from the DOS command line using the command
  243.        line switch /R like this:
  244.  
  245.                                  L /r datafile
  246.  
  247.        where datafile is name of the data file to read. The extension is
  248.        not necessary.
  249.  
  250.             You may read a data file once the program is running by
  251.        pressing the F3 key. This will produce a menu of the available data
  252.        files. Use the arrow keys to highlight a data file name and press
  253.        ENTER. If you have more data files than will fit on the menu, scroll
  254.        the menu by running the highlight bar off the menu. Press ESC if you
  255.        decide not to read a data file.
  256.  
  257.     2.3 Help
  258.  
  259.             Pressing the F1 key will activate L.EXE's help system. A
  260.        small menu will appear in the middle of the screen listing the
  261.        help topics available to you. Highlight the topic you want help
  262.        on and press the ENTER key to see it.
  263.  
  264.             At the bottom of each help screen are listed all your
  265.        available options. Pressing ESC at any time will exit help and
  266.        return you to the main screen. Please be sure that L.HLP is in the
  267.        same directory as L.EXE or help will not be available!
  268.  
  269.     2.4 Quiet Mode Operation
  270.  
  271.             Start the program with the /Q command line switch if you do not
  272.         want to hear all the bells and whistles from the program. This will
  273.         silence everything with the exception of BC. BC.EXE is a separate
  274.         program and cannot be silenced by this program.
  275.  
  276.     2.5 Color Configuration
  277.  
  278.             You may set your own color combinations by pressing F4. This
  279.         will present a menu of the configurable options and two sample
  280.         windows. Use the arrow keys to highlight the item you wish to
  281.         change and press ENTER. This will produce a chart of the available
  282.         color combinations. Use the arrow keys to select the color
  283.         combination of your choice and press ENTER. You may exit the color
  284.         chart without selecting a color by pressing ESC.
  285.  
  286.             After setting the colors you have three exiting options. Choose
  287.         "Exit with old colors" to ignore all the changes you have made. If
  288.         you select "Exit with new colors", the new colors will be in effect
  289.         until you exit the program. "Write colors to disk" will create a
  290.         file named L.CFG in the same directory as L.EXE. Doing this will
  291.         set new default colors that will be read by L.EXE every time it
  292.         starts. Use this to permanently set your new colors.
  293.  
  294.     2.6 Text Editor Operation
  295.  
  296.             You may run a text editor directly from L.EXE by pressing ALT-E
  297.         while at the main screen. This will invoke your text editor
  298.         directly. There are no parameters passed to the editor. After
  299.         exiting the editor you will be returned to the main screen.
  300.  
  301.             Press Ctrl-E to configure the text editor name. This will
  302.         allow you to use your favorite editor to work directly with your
  303.         source code. Your default editor choice is saved when you save your
  304.         color configuration (see the above section).
  305.  
  306.     2.7 Other Information
  307.  
  308.             There are two other keys that have special meaning to L.EXE.
  309.         Pressing ESC while at the main screen will exit the program. The
  310.         TAB key will start the compiling/linking process, as covered in the
  311.         next section.
  312.  
  313.             SECTION THREE: Compiling and Linking your Program
  314.  
  315.     3.1 General Operation
  316.  
  317.             Now that you have entered all the necessary data to create
  318.        your program, press the TAB key and let it fly. L.EXE will first
  319.        locate your source file(s) and call BC to compile them one at a time.
  320.        If any modules compile with errors L.EXE will detect this condition
  321.        and halt the process. You will then be brought back to the main
  322.        screen where you may be able to correct the problem and try it again.
  323.  
  324.             Once a module has compiled without errors, L.EXE will clear
  325.         the archive bit of the source file. When compiling, L.EXE first
  326.         checks for the presence of an object file of the same name as the
  327.         source. If this object file exists, L.EXE then checks the archive
  328.         bit of the source code. If the archive bit is clear, L.EXE will
  329.         skip compiling this module and continue with the next. This
  330.         intelligent selection will really save time on large programs,
  331.         because it will compile only those modules that need compiling.
  332.  
  333.             Once everything is compiled, L.EXE will call LINK.EXE to link
  334.        your program. L.EXE will set up the link call using the switches,
  335.        libraries, and stub files you specified in the information section.
  336.        Once again L.EXE will supervise the linking process and return to
  337.        the main screen should an error occur. When the new program is
  338.        completed L.EXE will automatically exit to DOS.
  339.  
  340.     3.2 Single 5.25" Drive System:
  341.  
  342.             I'm not going to kid you here. Using a single drive system
  343.        poses some serious limitations on your final program size. You
  344.        will need three blank floppy disks. Label them A, B, and C, and
  345.        set them up as follows:
  346.  
  347.                                 DISK A
  348.                                 ------
  349.                                 L.EXE
  350.                                 BC.EXE
  351.                                LINK.EXE
  352.                            Your source file(s)
  353.  
  354.                                 DISK B
  355.                                 ------
  356.                               BCOM40.LIB or
  357.                               BCOM45.LIB or
  358.                           Other run-time library
  359.                             Any toolbox library
  360.                              Any stub files
  361.  
  362.                                 DISK C
  363.                                 ------
  364.                                 BLANK
  365.  
  366.  
  367.             Start L.EXE from Disk A. Leave the paths to the source files,
  368.        BC and LINK blank. Set the library and object file paths to "b:"
  369.        (without quotes). Set the switches as you desire, but include the
  370.        /PAU switch for LINK. After the above is done press the TAB key to
  371.        start. When LINK starts you will be prompted to swap disks in drive
  372.        A:. When LINK asks for the disk for drive B: insert your B disk. You
  373.        will need to swap disks a couple of more times before the process is
  374.        complete.
  375.  
  376.             Before LINK writes the final executable program, it will ask
  377.        you to place a new disk in drive A:. Insert your final blank disk
  378.        (DISK C) into the drive and push ENTER twice. The third disk will
  379.        now contain your finished program.
  380.  
  381.             You can create an extra 42K of disk space if you start L.EXE
  382.        from a different disk and eliminate it from DISK A. Once the main
  383.        screen appears it is safe to remove the program diskette from the
  384.        drive.
  385.  
  386.     3.3 Single 3.5" Drive System
  387.  
  388.             This configuration will give much needed breathing room. You can
  389.        do the entire process from one disk. However, if you follow the
  390.        procedure for a 5.25" drive system (without the third blank disk) you
  391.        can create programs of virtually unlimited size. You will still need
  392.        to swap disks when prompted.
  393.  
  394.     3.4 Dual Drive System (any size drives)
  395.  
  396.             The procedure is basically the same as a single drive
  397.        system. The advantage here is no disk swapping should be needed.
  398.        Put DISK A in drive A: and DISK B in drive B:. For two 5.25"
  399.        drives I still recommend using the /PAU link option and a third
  400.        blank disk.
  401.  
  402.     3.5 Hard Disk System
  403.  
  404.             Here is where you will receive the full benefit of L.EXE's
  405.        services. You are encouraged to separate different type files into
  406.        their own subdirectories. Doing so will make finding different files
  407.        easier as well as cleaning your QB directory up quite nicely.
  408.        QuickBASIC itself can be set up to use multiple subdirectories.
  409.  
  410.             Another advantage is speed. L.EXE can compile and link a program
  411.        about three times as fast on a hard disk as on floppies. Yet another
  412.        advantage is in the additions you can make to your program. Some
  413.        toolbox kits will not fit on a floppy disk along with a run-time
  414.        library. Using a hard disk means you can use two, three, or more
  415.        libraries and three or four stub files without fear of the "Disk Full"
  416.        error.
  417.  
  418.             To use L.EXE on a hard disk just enter the path information
  419.        into the proper areas and use it. L.EXE was designed to be run from
  420.        its own directory on your PATH. You are free to choose the method that
  421.        suits you best.
  422.  
  423.     3.6 Command Line Operation
  424.  
  425.             L.EXE can operate in batch mode for use in batch files. This
  426.         requires a data file that contains enough information to compile
  427.         and link a program. Invoke batch mode by using the /C command line
  428.         switch like this:
  429.                                  L /c datafile
  430.  
  431.         where datafile is the name of the data file describing the source
  432.         code to compile and link. When started in this manner, L.EXE will
  433.         first examine the file for accuracy, and then immediately compile
  434.         and link your program. Should an error occur L.EXE will set the DOS
  435.         ERRORLEVEL to a value of 50. You may test for this condition in the
  436.         batch file to determine the success of the operation.
  437.  
  438.             At no time during batch operation will the main screen be
  439.         shown. If an error occurs, the process of compiling and linking is
  440.         halted and the program exits with the ERRORLEVEL set. Any error at
  441.         all will print an error message and exit.
  442.  
  443.                         SECTION FOUR: Other Information
  444.  
  445.     4.1 Site License Agreement
  446.  
  447.             This program is distributed by the Shareware concept. It is
  448.        not free. You are granted limited license to use L.EXE on your
  449.        system to determine its suitability.
  450.  
  451.             You are encouraged to give L.EXE to your friends and upload
  452.        it on your favorite BBS provided you adhere to these terms:
  453.  
  454.             You cannot charge a fee for the program. You may charge a
  455.             distribution fee if you advise users this fee is for distri-
  456.             bution purposes only and not for the program itself.
  457.  
  458.             You must include all the files included with this package in
  459.             complete and unmodified form.
  460.  
  461.             If you find this utility helpful and plan to use it on your
  462.        system, please register your copy. Registration provides complete
  463.        support for this program, update notices, and the latest version on
  464.        disk. The registration form is in the text file REGISTER.DOC
  465.        included with this package.
  466.  
  467.     4.2 Disclaimer
  468.  
  469.             This program is supplied as-is, with no warranty of any kind
  470.         either written or implied. Sequential Software Inc. and Robin Duffy
  471.         can assume no liability for any damages (either real or imagined)
  472.         resulting from the use of this software. Furthermore, we make no
  473.         guarantee as to the suitability of this software for any purpose.
  474.  
  475.     4.3 Final Words
  476.  
  477.             I would like to thank you for trying this program. BASIC has an
  478.         undeserved stigma of not being a real language. I, in my own little
  479.         way, hope to erase this stigma and reveal BASIC as a valid tool to
  480.         create useful applications. Perhaps a make utility such as this
  481.         will provide flexibility to programmers, who in turn can get the
  482.         most from their programs in terms of size and speed. Perhaps you
  483.         are one of these programmers.
  484.  
  485.  
  486.  
  487.  
  488.                               SUPPORT SHAREWARE!
  489.  
  490.