home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 15 / CDACTUAL15.iso / cdactual / program / basic / QBPRO7.ZIP / V7.TXT < prev    next >
Encoding:
Text File  |  1989-08-02  |  18.3 KB  |  413 lines

  1.                             QB/Pro Volume 7
  2.                             
  3.                             "QB Optimizer"
  4.  
  5.  
  6.                         -= H I G H L I G H T S =-
  7.                         
  8.  
  9.                  Substantially Smaller Standalone Programs
  10.                  =========================================
  11.               
  12.    We supply you with several "XModules" that replace unneeded MS library 
  13.    routines when you compile with "/O". Using all of the supplied modules can 
  14.    result in functional programs that are less than 4K in size!
  15.  
  16.    The XModules are similar in concept to NOCOM.OBJ and SMALLERR.OBJ. See the 
  17.    detailed explanation below.
  18.    
  19.    
  20.                         OPT.EXE - Optimizer Utility
  21.                         ===========================
  22.  
  23.     1) Optionally converts BASIC source files (no matter how messy) 
  24.        to structured code, including indenting logical fragments.
  25.     2) Indentation levels and tab stops are user configurable. 
  26.     3) Optionally strip out unreferenced line numbers/labels.
  27.     4) Optionally add line numbers for easier debugging with ON ERROR. 
  28.     5) Optionally remove variable names from NEXT statements, for faster 
  29.        programs. 
  30.     6) Optionally align remarks. You select what column they start in.
  31.     7) Optionally prints formatted listing to printer or file. Use 
  32.        metacommands to describe output.
  33.     8) Ideal for converting your programs for use with QB4 and BASCOM 6.
  34.     9) Process multiple files in one run, either interactively or command 
  35.        line driven.
  36.  
  37.  
  38.                        PP.EXE - Pre-Processor Utility
  39.                        ==============================
  40.  
  41.     1) Allows conditional compiling to provide different versions of programs
  42.        for different clients, projects, debugging, etc. 
  43.     2) Conditional compiling can be done using numeric or string symbols.
  44.     3) Use $Include with SUBs and FUNCTIONs.
  45.     4) All compiler and LINK commands become part of your source, so no more 
  46.        batch files to worry about. We use statements similar to "metacommands",
  47.        so there's no overhead penalty in your .EXE files.
  48.     5) Processes in excess of 20,000 lines per minute on 386 machines with 
  49.        18ms hard disk and almost 10,000 LPM on a 286 with a 28ms hard disk.
  50.     6) Built in subset of MicroHelp's MAKE facility, so programs and dependent
  51.        BASIC modules are compiled and LINKed only when necessary.
  52.        
  53.  
  54.                      XREF.EXE - Cross Reference Utility
  55.                      ==================================
  56.  
  57.     1) Cross references all variables and literals.
  58.     2) Identifies physical lines in file where variables are referenced and 
  59.        where they are changed. This assists you during debugging, since you 
  60.        are shown all lines where variables can take on spurious values.
  61.     3) Cross references all line numbers and labels, including SUBs and 
  62.        FUNCTIONs.
  63.     4) Identifies physical lines in file where labels/line numbers/procedures 
  64.        are referenced as well as where they are located and DECLAREd.
  65.  
  66.  
  67.                       Programming Tips in the Manual
  68.                       ==============================
  69.  
  70.     QB Optimizer includes a fully indexed three-ring bound manual. One section
  71.     of the manual is devoted to programming tips: Faster Programs, Smaller 
  72.     Programs and Other Tips.
  73.  
  74.  
  75.                              -= D E T A I L S =-
  76.  
  77.                               - The  XModules - 
  78.                   
  79.    LINK these modules with your program when you don't need 
  80.    the corresponding BCOMxx.LIB routines. The number of bytes saved (shown 
  81.    for each module) is based on BC 4.00b and LINKing with /EXEPACK. Similar 
  82.    savings are obtained with BC 4.50 and BC 6.00x.
  83.     
  84.    Use all of these modules in your programs and save 16,796 bytes each! That 
  85.    means functional programs less than 4K in size.
  86.    
  87.    * XERROR.OBJ is used when you don't need error trapping, redirection and 
  88.      ^Break trapping. Saves 2284 bytes per program.
  89.    * XFLOAT.OBJ is available when your program uses only integers and long 
  90.      integers. Saves 9386 bytes per program. Note that there are some BASIC 
  91.      statements, including graphics and trig, that use floating point math 
  92.      and therefore cannot be used with this module. Because STR$() and VAL 
  93.      cannot be used, consider using QB/Pro Volume 2, which has replacements 
  94.      for these functions.
  95.    * XGRAPH.OBJ is used when you don't need any graphics capabilities. Saves 
  96.      240 bytes per program. If using XVIDEO.OBJ, this module is not needed.
  97.    * XREDIR.OBJ is for when you don't need redirection and checking for ^Break.
  98.      Saves 180 bytes per program.
  99.    * XVIDEO.OBJ is used when you don't need any video related routines. For 
  100.      example, if you use only assembler routines for screen displays, you 
  101.      probably can use this module! Saves 2870 bytes per program. We supply 
  102.      you with assembler equivalents of: LOCATE; SCREEN 0,0,0; WIDTH 80,43; 
  103.      and WIDTH 80,50.
  104.    * XINPUT.OBJ can be used when you don't need any input or screen oriented 
  105.      routines. Also forgoes critical error handling and overflow error 
  106.      detection. Saves 1520 bytes per program. We supply you with an assembler 
  107.      routine that is the equivalent of INKEY$, but also returns the scan code, 
  108.      shift status and ASCII code. Use Mach 2 and other QB/Pro Volumes to 
  109.      perform edited input and critical error handling.
  110.    * XINTS.OBJ, used only when you also use XINPUT.OBJ, is for when you don't 
  111.      need BASIC's commands that deal with the timer or keyboard. Saves 768 
  112.      bytes per program.
  113.      
  114.    Suppose you want to use as many XModules as you can, but you're not sure 
  115.    which ones will work with your programs? No problem. We include another 
  116.    utility called CHECKX.EXE that will tell you! This program is so good, 
  117.    that it will actually identify the lines, and point to the BASIC reserved 
  118.    words that prevent you from using a particular module!
  119.  
  120.                        - The Optimizer Utility - 
  121.    Forget about unreadable code! OPT.EXE takes the 
  122.    messiest source code and makes sense out of it. For starters, OPT will 
  123.    analyze your code and indent the following structures:
  124.  
  125.     FOR/NEXT
  126.     WHILE/WEND
  127.     SELECT CASE..CASE..END SELECT
  128.     IF..THEN..ELSE (into structured blocks)
  129.     DO..LOOP
  130.     SUB..END SUB
  131.     FUNCTION..END FUNCTION 
  132.     DEF FN..END DEF
  133.     
  134.    You select the indentation spacing (i.e., every x spaces) and tell OPT 
  135.    whether to use TAB characters or spaces.
  136.    
  137.    Since OPT can be run either interactively or as a command line program, you
  138.    have more freedom. For example, when you first get the program, you can:
  139.    
  140.                        OPT *.BAS; <Enter>
  141.                        
  142.    That command will process all *.BAS files in the current directory while 
  143.    you're out to lunch! After that, simply run OPT with single programs when 
  144.    you change them.
  145.    
  146.    If you use error trapping and line numbers, you'll want to use OPT to strip 
  147.    out all unreferenced line numbers. This results in smaller .EXE files.
  148.    
  149.    If you don't like the message "Error in module xxxx at address yyyy:zzzz", 
  150.    use OPT to temporarily add line numbers to your program for debugging 
  151.    purposes. You even get to choose the line number increments! When you're 
  152.    finished, use OPT again to strip the line numbers back out!
  153.    
  154.    Taking advantage of remark alignment, you can make your programs much more 
  155.    readable. This means that when you are coding your programs, you can type 
  156.    as fast as you want and put REMs wherever you want -  then let OPT 
  157.    align them.
  158.    
  159.    Using standard metacommands, you can have OPT print beautifully formatted 
  160.    program listings. You specify title, subtitles, page length and page width. 
  161.    You can even force a page break!
  162.  
  163.                          - The Pre-Processor Utility - 
  164.              
  165.    Conditional compiling has long been available to 
  166.    programmers using languages other than BASIC. Now, for the first time, you 
  167.    can take advantage of this extremely powerful technology!
  168.    
  169.    Suppose you have two clients: IBM and Sears, and each of them uses a big 
  170.    application program you've written, but they each want slightly different 
  171.    features in several of your SUBprograms. Up until now, you've had to 
  172.    maintain separate versions of your program for each client, or go through 
  173.    some inelegant tricks to get the desired .EXE files.
  174.    
  175.    With our Pre-processor, it's a piece of cake! Here's how it's done:
  176.    
  177.     TopOfProgram:
  178.       'Name your client
  179.       '#Client$ = IBM
  180.   
  181.     SUB AnySub(Parameter1)
  182.       '#IF Client$ = IBM
  183.            PRINT "Customer: IBM"
  184.       '#ELSEIF Client$ = Sears
  185.            PRINT "Customer: Sears"
  186.       '#END IF
  187.     END SUB
  188.  
  189.    When you want to compile for Sears, change the "Precommand" at 
  190.    "TopOfProgram" to "Sears". When you want to compile for IBM, change it back!
  191.  
  192.    The Pre-Processor program will analyze your file and generate a temporary 
  193.    work file that is compiled (your source code is not compiled). In the 
  194.    example shown above, the work file will have only the appropriate code in 
  195.    it. In other words, it will have the line that prints IBM as the customer, 
  196.    but not the line that prints Sears. This makes for smaller, and usually 
  197.    faster programs.
  198.  
  199.    Because of this technology, you can use $Include with SUBprograms and 
  200.    FUNCTIONs. The Pre-Processor will read the include file and merge it into 
  201.    the work file along with your program. BC will think that you have a single 
  202.    program file and won't complain!
  203.  
  204.    You can also use numbers in your Precommands. As an example, suppose you 
  205.    have a system that can be used either "single user" or "network":
  206.  
  207.     TopOfProgram:
  208.       '#Network = 1
  209.     LaterInProgram:
  210.       '#IF Network
  211.           PRINT "Network version"
  212.       '#ELSE
  213.           PRINT "Single user version"
  214.       '#END IF
  215.  
  216.    Again, the work file that is compiled has only the appropriate BASIC code 
  217.    in it, not both PRINT statements.
  218.  
  219.    Taking things one step further, you can use any of the following 
  220.    Precommands:
  221.  
  222.     '#IF Network = 1
  223.     '#IF Network > 1
  224.     '#IF Network < 1
  225.     '#IF Network <> 1
  226.     '#IF Network >= 1
  227.     '#IF Network <= 1
  228.     
  229.    Precommands are also used to specify compiler switches, LINK switches, 
  230.    trailing object modules, leading object modules, etc. This means that the 
  231.    Pre-processor can be used in place of all those batch files you keep 
  232.    around. For example, suppose you have a RAM disk on drive E:, and a 
  233.    program called FOO.BAS, and the source code for FOO.BAS includes the 
  234.    following:
  235.  
  236.     '#CompilerName: 'BC'
  237.     '#CompileSwitches: '/O/E'
  238.     '#WorkPath: 'E:\'
  239.     '#LinkSwitches: '/EXE/NOE'
  240.     '#EXEName: 'MYPROG'
  241.     '#EXEPath: 'C:\PROGS'
  242.     '#LeadingObject: 'STAYQB4'
  243.     '#TrailingObject: 'FOO2'
  244.     '#Libraries: 'MHLIB2 MHPRO7'
  245.     
  246.    When you execute the Pre-Processor, it will analyze your file and create a 
  247.    temporary work file called E:\FOO.$$$ on your RAM disk. It will then 
  248.    generate compiler and LINK commands that look like this:
  249.  
  250.     BC /O/E E:\FOO.$$$,FOO.OBJ;
  251.     LINK /EXE/NOE STAYQB4+E:\FOO+FOO2,C:\PROGS\MYPROG.EXE,,MHLIB2+MHPRO7;
  252.     
  253.    If you have LIM Expanded Memory (version 3.2 or later), or a hard disk or 
  254.    a RAM disk, the Pre-Processor consumes only 10K during the compiling and 
  255.    LINKing process, so don't worry about it being a memory hog.
  256.    
  257.    Because the Pre-Processor is smart, it will compile FOO only if the source 
  258.    code FOO.BAS is newer than the existing FOO.OBJ module. LINKing will take 
  259.    place only if the object modules are newer than the existing .EXE program! 
  260.    That means it's easy to "freshen" your programs. Using the above example, 
  261.    simply:
  262.    
  263.                              PP FOO <Enter>
  264.                              
  265.    If FOO doesn't need compiling and LINKing, the Pre-Processor will tell you 
  266.    so and you'll be done in no time.
  267.    
  268.                      - The Cross Reference Utility - 
  269.              
  270.    The best way to explain this program is to 
  271.    provide you with an example. We'll start with the source code shown below 
  272.    (XREFTEST.BAS). Note that the line numbers on the left are the physical line
  273.    numbers in the file and are not part of the source code. They have been 
  274.    added only to facilitate your moving between the cross reference listing 
  275.    and the program itself:
  276.  
  277.      1 '    BAS This is a sample program designed to produce an
  278.      2 '    interesting cross-reference file.
  279.      3
  280.      4  A = 1
  281.      5  B = 2
  282.      6  C = 3
  283.      7 Top:
  284.      8  D = A * B
  285.      9  A = A + 1
  286.     10  B$ = "Hello"
  287.     11  C$ = " World"
  288.     12  PRINT C$
  289.     13  IF A < 3 GOTO Top
  290.     14  RESTORE Bottom
  291.     15  READ A$
  292.     16 Bottom:
  293.     17  DATA Cruel
  294.  
  295.   Here is the actual output produced by the XREF program:
  296.  
  297.     XREFTEST.BAS   Date: 05-25-1989   Time: 14:53:20    Page:  1
  298.  
  299.     1                   4      9
  300.     2                   5
  301.     3                   6     13
  302.     @Bottom            14     16*
  303.     @Top                7*    13
  304.     A                   4*     8      9*     9     13
  305.     A$                 15*
  306.     B                   5*     8
  307.     B$                 10*
  308.     C                   6*
  309.     C$                 11*    12
  310.     D                   8*
  311.     
  312.   Starting from the top, here's an explanation for some of the output:
  313.  
  314.     -The literal "1" is found on lines 4 and 9.
  315.     -The literals "2" and "3" are found on their respective lines.
  316.     -The label "Bottom" is found on line 16 (since there is an asterisk), and 
  317.      is referenced on line 14. The label "Top" is similarly marked.
  318.     -The variable "A" changes value on lines 4 and 9 (since there are 
  319.      asterisks). Note that there are two occurrences of "A" on line 9, so two 
  320.      nines are shown.
  321.     -A$ is changed on line 15, but there are no other references to it. 
  322.   
  323.    Why Should You Use XREF? In the cross reference listing there are several 
  324.    items worth examining:
  325.  
  326.     -The literal "1" appears twice. If your program is speed critical, consider
  327.      adding "One% = 1" to the top of your program and then substituting "One%" 
  328.      for each occurrence of the literal "1". Using a variable is much faster 
  329.      than using a literal, since the compiler doesn't have to generate a 
  330.      "temporary" variable.
  331.     -Knowing where variables are changed can help immensely when it comes to 
  332.      debugging a program. For example, if a variable has an unusual value in 
  333.      the middle of your program, and you don't have any idea how it happened, 
  334.      use QuickBASIC's environment to set breakpoints on all lines that change 
  335.      the variable and then examine the variable each time it is changed.
  336.     -You can get rid of unnecessary variables. For example, A$ appears only on
  337.      line 15. So why should it be in the program? Ditto for B$ and "D".
  338.     -Similarly, you may have line labels or procedures that are not referenced
  339.      by any other portion of your code. In that case, you may wish to remove 
  340.      them. As an aside, we often leave unreferenced labels in our programs 
  341.      that are used in a fashion similar to remarks. In other words, they are 
  342.      placeholders, or navigational guides. There's nothing wrong with making 
  343.      them into remarks, however! Just put an apostrophe in front of the label.
  344.  
  345.  
  346.                             System Requirements
  347.                             ===================
  348.  
  349.     The minimum system requirements for using QB Optimizer are:
  350.  
  351.         * An IBM PC, XT, AT, PS/2 or close compatible.
  352.         * PC/MS DOS version 3.00 or later. 
  353.         * Any Microsoft or IBM BASIC compiler.
  354.         * A hard disk (fixed disk).
  355.         * 1 Diskette drive (5.25"). 3.5" disks are available for a nominal 
  356.           charge.
  357.         * An 80 column monitor.
  358.         
  359.         
  360.                             Special Requirements
  361.                             ====================
  362.  
  363.     * Use of the XModules requires compiling with /O and one of: Microsoft 
  364.       QuickBASIC (4.00b or 4.50) or the Microsoft BASIC Compiler 6.0x. In 
  365.       fact, the modules are actually "library dependent" - you must LINK 
  366.       with one of: BCOM41.LIB, BCOM45.LIB, BCOM60xx.LIB or BCOM61xx.LIB. 
  367.       If Microsoft releases a newer version of either compiler, please 
  368.       check with us for compatibility.
  369.  
  370.     * Using the "convert to structured code" feature in the OPT.EXE program 
  371.       requires that you are using Microsoft QuickBASIC 2.0 or later.
  372.  
  373.     * Using the "Add line numbers" feature of the OPT.EXE program requires 
  374.       that you are using Microsoft QuickBASIC 1.0 or later.
  375.       
  376.  
  377.                              Try Before You Buy
  378.                              ==================
  379.  
  380.     Call us and order QB/Pro Volume 7 and be sure to ask us to include our 
  381.     demo disk. The demo consists of the following files:
  382.  
  383.         * Source code and executable program created using all of the 
  384.           XModules. See the size for yourself.
  385.  
  386.         * Limited use versions of OPT.EXE and XREF.EXE. These demonstration 
  387.           programs can be used on your own source code, but are limited to 
  388.           programs of less than 200 lines in length.
  389.  
  390.         * The XREFTEST program shown above. Use the demo version of XREF.EXE 
  391.           to create a cross reference listing.
  392.  
  393.         * A program written for use with the Pre-Processor program, including 
  394.           the temporary work file created for compiling.
  395.  
  396.     When you receive the package, don't open the software - just try the demo 
  397.     programs. If you're still not convinced that you need this marvelous set 
  398.     of utilities, simply return the software unopened. We'll refund the amount 
  399.     of the purchase, no questions asked. All you pay is shipping.
  400.  
  401.     Or, if you prefer, send us a check for $5.00 (no credit cards or COD's 
  402.     please) and we'll send you our demo disk. If you decide to buy QB 
  403.     Optimizer after seeing our demo, we'll credit the $5.00 towards your 
  404.     purchase.
  405.  
  406.  
  407.                              Ordering Information
  408.                              ====================
  409.                              
  410.     The cost of QB/Pro Volume 7 is $89 plus $4 for UPS ground shipping. If you
  411.     would like more information or would like to place an order, please call 
  412.     toll-free at 1-800-922-3383, or in Georgia (404) 552-0565.
  413.