home *** CD-ROM | disk | FTP | other *** search
/ The Devil's Doorknob BBS Capture (1996-2003) / devilsdoorknobbbscapture1996-2003.iso / Dloads / PROGRAMM / BUILDER.ZIP / TECHNOTE.TXT < prev    next >
Text File  |  1992-11-17  |  31KB  |  923 lines

  1. Additional BUILDER 2.0 programming tips and information.  Please
  2. print out this file for your future reference.
  3.  
  4.  
  5. This file deals with several BUILDER 2.0 programming issues.  In order
  6. of appearence, they are:
  7.  
  8.             1) The TOOLS menu of the BUILDER 2.0
  9.                Integrated Development Environment
  10.                (and the programs that relate to
  11.                that menu).
  12.  
  13.             2) The BUILDER 2.0 Help Compiler.
  14.  
  15.             3) Linking multiple .OBJs with BUILDER
  16.                2.0.
  17.  
  18.             4) Subroutines passing and returning
  19.                values.
  20.  
  21.      
  22.  
  23. Tools Menu - BUILDER 2.0 Integrated Development Environment
  24.  
  25.      The Tools menu is represented by the three
  26.      horizontal lines on the far left of the
  27.      LightBar menu at the top of the screen.  You
  28.      may activate this menu choice by either
  29.      pressing {Ctrl Space}, or by clicking on it
  30.      with your mouse.
  31.  
  32.      Once you've selected the Tools main menu
  33.      option, a DropDown menu will appear
  34.      presenting more choices.  We will concern
  35.      ourselves in this text with IG - the
  36.      Installation Generator, ONLINE - the BUILDER
  37.      telecommunication interface, and MG - the
  38.      Menu Generator.  (A discussion of the Tools
  39.      menu ASCII chart and its operation is
  40.      included in Chapter 5 of the BUILDER 2.0
  41.      manual).
  42.  
  43. What is a tool?
  44.      Simply put, a tool is something that helps
  45.      you do your job.  In the case of a
  46.      programming tool, a tool helps you to develop
  47.      faster, better, or more flexible programs
  48.      than you could without it.
  49.  
  50.      As you know, BUILDER is a language.  But not
  51.      just any language, it's a compiled language.
  52.      As a compiled language, it is comprised of
  53.      many tools.  The tools you use when you fire
  54.      up BUILDER are:
  55.  
  56.             1) Text editor (BUILDER.EXE, the IDE)
  57.             2) Compiler (BLD.EXE)
  58.             3) Linker (MLINK.EXE)
  59.             4) Runtime library (BLD.LIB)
  60.  
  61.      In BUILDERs case, all of these tools work
  62.      together to allow you to create, compile and
  63.      link a program.  Sometimes tools work on
  64.      their own, other times they work in tandem.
  65.  
  66.      The code generators and communications
  67.      interface that are available to you under the
  68.      Tools menu also fall into the general
  69.      category of programming tools.
  70.  
  71.  
  72. Code generators
  73.  
  74.      Code generators allow you to create the
  75.      native language script that is then compiled
  76.      to create a running program.  Code generators
  77.      work in various ways to accomplish this task.
  78.      The code generators that are provided with
  79.      BUILDER 2.0 will help you to quickly create
  80.      bullet-proof installation scripts or slick
  81.      front-end menus.
  82.  
  83.      The BUILDER code generators create scripts
  84.      that compile into Installation programs or
  85.      Menu front-ends.  By making a series of menu
  86.      choices, the code generators can determine
  87.      how you want something to look, and how you
  88.      would like it to behave.  With that
  89.      clarified, the code generator can then go
  90.      about its work of assembling the correct
  91.      commands in the proper order to accomplish
  92.      the task.  The result is a source code or
  93.      native language script that, once compiled,
  94.      will perform as you have instructed it to.
  95.  
  96.      The native language script that is created by
  97.      the code generator can be edited and modified
  98.      before compiling.  The source code can be
  99.      modified further after compiling in order to
  100.      continue to enhance the compiled program.
  101.  
  102.  
  103. ONLINE
  104.  
  105.      The remaining Tools menu option is the
  106.      BUILDER ONLINE interface.  This tool allows
  107.      you to access our electronic Bulletin Board
  108.      Service (BBS), through your modem, from
  109.      within the BUILDER IDE.
  110.  
  111.      The best user-based feed back on hyperkinetix
  112.      programming tools is our proprietary BBS.
  113.      The hyper BBS, hyperactivity, receives visits
  114.      24 hours a day from programmers all over the
  115.      world.  Through hyperactivity you have access
  116.      to thousands of lines of BUILDER code,
  117.      thousands of BUILDER users, and the entire
  118.      hyperkinetix support and development staff.
  119.  
  120.      If you have any problems on your first
  121.      connection to the BBS please call.  You'll
  122.      find that direct electronic access to us will
  123.      increase your productivity and reduce your
  124.      downtime.
  125.  
  126.      
  127.  
  128.  
  129. IG - the Installation Generator
  130.  
  131.      IG.EXE is the installation script code
  132.      generator that is activated from the Tools
  133.      menu by pressing {I}.  This chapter will
  134.      familiarize you the operation of BUILDER's
  135.      IG.EXE.  By the end of this section you'll
  136.      understand what an installation program is,
  137.      how IG.EXE works, and why IG.EXE is the only
  138.      way to go if you're looking for an effective
  139.      tool to quickly create bullet proof
  140.      installation scripts.
  141.  
  142. What's an installation program?
  143.  
  144.      An installation program is distributed with
  145.      most software in order to copy or "install"
  146.      the program from a removeable, or floppy
  147.      diskette onto a fixed disk, or hard drive.
  148.  
  149.      By this definition, it's hard to understand
  150.      why a good installation program is so highly
  151.      regarded.  It would be fair to say that
  152.      although the definition given above
  153.      accurately describes the objective of an
  154.      installation program, it doesn't begin to
  155.      explain the problems encountered when you
  156.      develop a program that is supposed to be
  157.      flexible, fast, and fool-proof.
  158.  
  159.      One of the most used abilities of BUILDER is
  160.      that of installation script creation.  We
  161.      write the installation scripts for all of our
  162.      commercial software in BUILDER!  We do so for
  163.      many reasons:
  164.  
  165.             1) Small compiled code size
  166.             2) Bullet-proof .EXE files
  167.             3) Easily maintained code
  168.             4) We can brag about it!
  169.  
  170.      We think you'll brag about your experience
  171.      with BUILDERs IG.EXE, too!
  172.  
  173. IG.EXE unveiled
  174.  
  175.      When creating an installation program, you
  176.      must consider several factors which are not
  177.      in your control, but by which your program
  178.      will have to abide.  Because of this, a good
  179.      installation script will allow the user to
  180.      make choices, and the program itself will
  181.      only execute those choices if they are valid,
  182.      and possible.
  183.  
  184.      Some considerations:
  185.  
  186.      Source drive-  Will your software ship on
  187.      dual media.  Should the user have a choice of
  188.      installing from A drive, B drive, etc?
  189.  
  190.      Target drive-  Where should this program be
  191.      copied to?  C drive is common, but should
  192.      there be a choice?
  193.  
  194.      Target directory-  Where on the drive should
  195.      these files reside, does that matter, is it
  196.      an update to a series of files already on the
  197.      users machine?
  198.  
  199.      Along with these decisions are a series of
  200.      equally important questions.  Is there enough
  201.      free disk space to hold the installation?
  202.      Should you compress the distribution files?
  203.      Will the user have the utility to uncompress?
  204.      When the installation is complete should the
  205.      user be informed, and how?
  206.  
  207.      You can begin to see why just copying the
  208.      files from A: to C: without a smart
  209.      installation or any user interaction can be
  210.      dangerous.
  211.  
  212.      IG.EXE is not designed to create the most
  213.      powerful installation you can get from
  214.      BUILDER.  IG.EXE is designed to create an
  215.      installation that will save your user from
  216.      making a huge mistake, but save you from
  217.      spending any more than 10 minutes on your
  218.      install.  Obviously you can tweak and
  219.      customize the code that IG.EXE creates.  We
  220.      encourage you to do so.  But we also know
  221.      that a solid, consistent installation is the
  222.      best first impression you can make with
  223.      users.  That is the goal of IG.EXE.
  224.  
  225. Your options
  226.      In preparing to use IG.EXE you should assure
  227.      that the following is true:
  228.  
  229.             1) IG.EXE, BLD.EXE, BLD.LIB, and
  230.                MLINK.EXE are on the PATH.
  231.             2) All of the files you want included
  232.                in the installation are in a
  233.                directory, and appropriate sub-
  234.                directories, that is named exactly
  235.                as it should be on the end users
  236.                machine after the installation is
  237.                complete.
  238.             3) You are in that directory.
  239.  
  240.      Type IG at the DOS prompt and ENTER through
  241.      the opening dialogue box.  A LightBar menu
  242.      will appear that allows the following
  243.      choices, File, BUILD, and Options.  Select
  244.      these options by pressing {Alt} and the
  245.      hotkey {F}, {B}, or {O}, or click on the item
  246.      with your mouse.
  247.  
  248. File menu
  249.  
  250.      The File menu allows you to shell out to DOS.
  251.      You can also accomplish this with the hotkey
  252.      combination {Alt S}.  From the Files menu you
  253.      can also re-display the sign-on box by
  254.      selecting About.  Quit by selecting Quit.
  255.      You may also exit IG.EXE with the hotkey
  256.      combination {Alt X}.
  257.  
  258. BUILD menu
  259.  
  260.      You should complete the Options menu before
  261.      entering the BUILD menu.  The Options menu
  262.      contains many critical choices regarding the
  263.      BUILDing of your distribution diskettes.
  264.  
  265.      This menu allows you to BUILD the actual
  266.      installation, and distribution disks.  The
  267.      only selection given is to BUILD your disks.
  268.      Selecting it will open a dialogue box that
  269.      queries you as to what files to use in
  270.      building the installation.  The default is
  271.      *.* because your resident directory should
  272.      include any and all files to be used in your
  273.      installation.  Your last decision in this
  274.      menu is whether or not to search sub-
  275.      directories for files to build your
  276.      installation disk(s).  Move between input
  277.      fields in the menus with the {Tab} key.
  278.      Select OK when you have made your choices,
  279.      and IG.EXE will go to work.
  280.  
  281.      IG.EXE will eventually ask you for the
  282.      location of your install disks.  This is the
  283.      drive location holding the diskettes that you
  284.      want the installation program and all of the
  285.      intended install files copied to.  Use {Tab}
  286.      to highlight your choice and press {Enter}.
  287.  
  288.      A success box is displayed when this process
  289.      is completed successfully, otherwise you will
  290.      receive an error message to act upon.
  291.  
  292. Options menu
  293.  
  294.      The Options menu contains the following
  295.      choice sub-menus:
  296.  
  297.      Compress toggle
  298.      Do you want your distribution disks built
  299.      with compressed (BCF) files?  Yes or no are
  300.      your selectable answers.
  301.  
  302.      Disk size
  303.      What size disk would you like the
  304.      installation written for.  IG.EXE will
  305.      automatically customize some of it parameters
  306.      to take maximum advantage of the disk size
  307.      you choose.  360k, 720k, 1.2M, and 1.4M are
  308.      your selectable answers.
  309.  
  310.      Disk fit method
  311.      Do you want IG.EXE to build the distribution
  312.      disks in the most space efficient manner, or
  313.      by the order they appear in the resident
  314.      directory.  You choose one or the other.
  315.  
  316.      Banner text
  317.      This information will appear when the
  318.      installation program starts up.  We recommend
  319.      that you use the first dialogue line for the
  320.      name of the program you are installing, and
  321.      the second line for you company name.
  322.  
  323.      Change README name
  324.      A README file designation must be made.
  325.      IG.EXE will place the file named here on the
  326.      first diskette.  We recommend that you use
  327.      this option for any file that you want the
  328.      user to have access to prior to the
  329.      installation.
  330.  
  331.      Default destination path
  332.      This option allows you to name the default
  333.      installation destination.  List the
  334.      destination by Drive:\Directory\Subdirectory
  335.      (if any).
  336.  
  337.      Needed drive space
  338.      Enter the amount of disk space, in bytes,
  339.      that the installation will require.  This
  340.      cannot be done dynamically by the
  341.      installation program if you are distributing
  342.      compressed files.  Enter the needed space in
  343.      bytes, not K.  100,000 would represent less
  344.      than 100K; remember there are 1024 bytes in a
  345.      K.
  346.  
  347.      Load configuration
  348.      If you have built and saved a set of options
  349.      for an installation before, you can load it
  350.      back into IG.EXE with this option.
  351.  
  352.      Save configuration
  353.      Before exiting you may want to save the
  354.      configuration for future use and reference.
  355.      There will be no prompt by IG.EXE to save a
  356.      configuration.
  357.  
  358.  
  359. The INSTALL.OBJ, .BLD files
  360.  
  361.      As IG.EXE did its job of write, compile, and
  362.      build it created some other files that you
  363.      may find useful.  A .OBJ file was created
  364.      that you could link into other applications.
  365.      A .BLD file was created for your further
  366.      editing and compiling.
  367.  
  368.      Astonishingly, that's it!  In ten minutes you
  369.      have an installation program that does
  370.      everything you need it to, and allows for you
  371.      to add more to it if you like.  Slick!
  372.  
  373.      
  374.  
  375.  
  376. MG - the Menu Generator
  377.      
  378.      MG.EXE is the front-end menu code generator
  379.      tool, a menu front-end is nothing more than a
  380.      shield most users stand behind to avoid
  381.      operating their computers from a DOS prompt.
  382.      It should be very easy to use, and of small
  383.      size in order to use as little RAM as
  384.      possible.
  385.  
  386. MG.EXE unveiled
  387.  
  388.      MG.EXE is a menu script generator.  Type MG
  389.      at a DOS prompt to activate the code
  390.      generator.  An environment will load
  391.      displaying a LightBar with the following
  392.      options File, Write, Colors, and Options.
  393.      Along the bottom of the editor box you will
  394.      also notice that {Alt X} will exit the
  395.      program.  Along that bottom line you also
  396.      find the Ins and Del options.
  397.  
  398.      Select an option by pressing {Alt} and the
  399.      items hotkey.  The following option
  400.      descriptions are in order of appearance.
  401.  
  402. File menu
  403.  
  404.      The File menu allows you to shell out to DOS.
  405.      You can also accomplish this with the hotkey
  406.      combination {Alt S}.  From the Files menu you
  407.      can also re-display the sign-on box by
  408.      selecting About.  Quit by selecting Quit.
  409.      You may also exit MG.EXE with the hotkey
  410.      combination {Alt X}.
  411.  
  412. Write menu
  413.  
  414.      This menu is used to activate the generator.
  415.      You will be asked to name the menu you are
  416.      creating, and then the generator will get
  417.      right to work.  It will not compile the code
  418.      it writes because you will need to customize
  419.      the program statements that you want the
  420.      selected item to execute.  But it will use
  421.      all of your other choices to display a look
  422.      alike menu prior to writing the code.
  423.  
  424. Colors menu
  425.  
  426.      This menu consists of four color setting
  427.      routines.
  428.  
  429.      set Item color
  430.      will bring up a dialogue box filled with
  431.      optional colors for your Foreground and
  432.      Background colors.  Select choices, using the
  433.      {Tab} key to navigate, and press OK.
  434.  
  435.      set hotkey color
  436.      will bring up a dialogue box filled with
  437.      optional colors for your Foreground and
  438.      Background colors.  Select choices, using the
  439.      {Tab} key to navigate, and press OK.
  440.  
  441.      set Highlight colors
  442.      will bring up a dialogue box filled with
  443.      optional colors for your Foreground and
  444.      Background colors.  Select choices, using the
  445.      {Tab} key to navigate, and press OK.
  446.  
  447.      set Box colors
  448.      will bring up a dialogue box filled with
  449.      optional colors for your Foreground and
  450.      Background colors.  Select choices, using the
  451.      {Tab} key to navigate, and press OK.
  452.  
  453. Options menu
  454.      The Options menu gives you more customizing
  455.      choices for your menu.
  456.  
  457.      Title string
  458.      allows you to name the menu that you are
  459.      creating.  This string will appear
  460.      immediately above the menu box.
  461.  
  462.      Box style
  463.      allows you to toggle between a single or
  464.      double lined box that will serve as a border
  465.      for your menu.
  466.  
  467.      First key
  468.      allows you to choose Y if the first letter in
  469.      each menu item is to serve as the hotkey, or
  470.      N if you are going to designate specific
  471.      hotkeys in the Item listing using the &
  472.      character.
  473.  
  474.      Immediate trigger
  475.      another Y / N choice to determine if the
  476.      hotkey should activate the item, or merely
  477.      move the highlight to that menu choice.
  478.  
  479.      Shadow toggle
  480.      gives you the Y / N option to have drop
  481.      shadows appear under the menu box, or not.
  482.  
  483. Creating menu items
  484.  
  485.      Press {Ins} to insert an item into your menu.
  486.      The items will begin to appear on screen
  487.      using the Color and Options choices you have
  488.      made.  Press {Del} to delete an item from you
  489.      menu.
  490.  
  491.      You will be able to see what your menu will
  492.      look like before your choices are cast into
  493.      an .EXE file.  Neat!
  494.  
  495.      You will need to load the .BLD file created
  496.      by MG.EXE into a text editor for final
  497.      modifications.  When you've got everything
  498.      just the way you want it, Compile and Run it.
  499.  
  500.      Don't feel bad if you make couple of changes
  501.      once you see how your color sections work
  502.      out.  We don't want to see your name on the
  503.      "Mr. Blackwell's 10 Worst Dressed Computers"
  504.      lists.
  505.  
  506.      
  507.  
  508.  
  509. ONLINE - the BUILDER Telecommunications Interface;
  510.      
  511.      ONLINE is the telecommunications interface
  512.      that is provided with BUILDER 2.0.  It allows
  513.      you to call into our BBS from within the
  514.      BUILDER IDE (even if you are right in the
  515.      middle of coding).  This means that tech
  516.      support is just an {Alt, Space} {O} away.
  517.      The benefit to this special tool is that you
  518.      can easily log on to our BBS and upload or
  519.      download files that may be helpful to you or
  520.      to others.  (Of course, ONLINE does require
  521.      you to have an operation modem properly
  522.      installed in your machine, and that the modem
  523.      is connected to an operating telephone line.)
  524.  
  525. What's ONLINE ACCESS?
  526.  
  527.      By definition it is a telecommunications
  528.      interface that is integrated into the BUILDER
  529.      2.0 development environment.  The existence
  530.      of this tools allows you to gain immediate
  531.      electronic entry to our BBS for tech support,
  532.      latest version downloading, example file
  533.      uploading and downloading, and anything else
  534.      you can think of.  We've also provided you
  535.      with the ability to enter a telephone number
  536.      on the fly and call any other BBS' you see
  537.      fit.
  538.  
  539.      As far as we know, BUILDER 2.0 is the only
  540.      programming language to offer this feature.
  541.      (We believe this will start a trend, NOT!)
  542.  
  543. ONLINE ACCESS unveiled
  544.      The use of ONLINE ACCESS is terribly simple.
  545.      Once you have selected {O} from the Tools
  546.      menu you will want to check your
  547.      configuration settings before actually
  548.      attempting to execute any of the other menu
  549.      options.
  550.  
  551.      The default configuration settings will
  552.      appear when you activate the Configuration
  553.      option.  They are:
  554.  
  555.             Port  -  This refers to the com port
  556.                where your modem is installed.  We
  557.                have defaulted to com port 1, but
  558.                your modem may be installed on com
  559.                port 2, 3, or 4.  Please refer to
  560.                your modem documentation for
  561.                verification.  (Note: a "failure to
  562.                initialize" error may indicate that
  563.                this setting is wrong)
  564.  
  565.             Speed  -  This refers to your modem
  566.                speed.  We have defaulted to 2400,
  567.                but you may choose 1200 or 9600
  568.                (please choose based on your
  569.                hardware).
  570.  
  571.             BBS Number  -  This entry box is
  572.                sensitive to the keyboard, and
  573.                defaults to our current BBS
  574.                telephone number.  It can be
  575.                changed with the Dial option, or
  576.                from this menu.
  577.  
  578.             Save  -  Selecting Save will save all
  579.                of your other options to the CONFIG
  580.                file and redefine your defaults.
  581.                If you modify a setting and don't
  582.                Save before exiting, then the
  583.                defaults will be reset at exit from
  584.                the BUILDER IDE.
  585.  
  586.      Having verified your Configuration, you now
  587.      operate this tool by selecting one of the
  588.      other menu choices.
  589.  
  590. Your options
  591.  
  592.      There are no questions to answer, just
  593.      functions to execute.  Let's take a look at
  594.      each of them:
  595.  
  596.      Send
  597.      Selected if you desire to Send a file via
  598.      your modem to our BBS.  The Send option will
  599.      open an input box and await keystroke entry.
  600.      When you have entered the file name (complete
  601.      with drive, directory, and extension
  602.      specifications) press {PageUp} to send the
  603.      file.
  604.  
  605.      Receive
  606.      Selected if you desire to Receive (or get) a
  607.      file via your modem from our BBS.  The
  608.      Receive option will open an input box and
  609.      await keystroke entry.  When you have entered
  610.      the file name (complete with drive,
  611.      directory, and extension specifications)
  612.      press {PageDown).
  613.  
  614.      Dial
  615.      Selected if you wish to override the default
  616.      telephone number that will be sent to the
  617.      modem for dialing.  An input box will appear
  618.      and await keystroke entry.  Upon completion,
  619.      press {Return} and the number will be dialed.
  620.  
  621.      HangUp
  622.      Pressing {Alt, H} will immediately interrupt
  623.      your call by disconnecting the modem.
  624.  
  625.      ShelltoDOS
  626.      Pressing {Alt S} will drop you to your DOS
  627.      prompt.  This feature is only available
  628.      OFFLINE.  This is helpful if you are
  629.      attempting to find or move a file, etc.
  630.  
  631.      Configuration
  632.      Discussed above.
  633.  
  634.      That's all there is to it.  Handy, neat, and
  635.      clean.  We hope that you'll use the ONLINE
  636.      ACCESS tool to gain more BUILDER programming
  637.      experience by downloading sample files,
  638.      sharing your ideas with other users, and
  639.      getting the electronic tech support you need.
  640.  
  641.      
  642.  
  643.      
  644. HELPCOMP.EXE - the Help System compiler
  645.  
  646.      Another unique feature of the BUILDER
  647.      compiled language is the ability to create a
  648.      help system for your BUILDER (or other)
  649.      applications.  This help system is comprised
  650.      of a .HLP file containing the help data that
  651.      will be displayed when the help system is
  652.      activated from your application.  The help
  653.      system you create will be accessible to your
  654.      user by pressing a developer defined hotkey.
  655.      {F1} is recommended as the help hotkey, as
  656.      most programs adhere to it as a standard.
  657.  
  658.      The help system operates from a menu of
  659.      selectable items.  For this reason, the help
  660.      system is easiest to use inside of BUILDER
  661.      created menu programs.
  662.  
  663.      This is a two step development process with
  664.      specific technical applications.  The first
  665.      step is to create the .HLP file, the second
  666.      step is to construct your BUILDER created
  667.      .EXE in such a way that it can call your .HLP
  668.      file.
  669.  
  670. Creating .HLP files
  671.  
  672.      To create your .HLP system you must write the
  673.      screen displays that you want activated when
  674.      help items are chosen.  The format for this
  675.      .TXT file (that will become the .HLP file) is
  676.      very stringent.  It is:
  677.  
  678.        #BEGIN Topic
  679.        Screen text of help topic.
  680.        More screen text.
  681.        Up to 50 lines of displayed text.
  682.        #END
  683.  
  684.      Each topic you want available to your help
  685.      system must have a #BEGIN Topic, and a #END.
  686.      You may include as few as one, or as many
  687.      lines of text to display as will fit in the
  688.      Help boundries.  The Help boundries you
  689.      establish when you compile your application
  690.      cannot exceed your screen size.  These lines
  691.      should appear EXACTLY as you want them
  692.      displayed.
  693.  
  694.      You needn't separate your Topic blocks with
  695.      blank lines.  Each #BEGIN will clue the
  696.      HELPCOMP.EXE compiler that you are beginning
  697.      a new Topic.  If HELPCOMP reads more than 50
  698.      lines without finding #END, it will assume
  699.      you made an error and halt operation telling
  700.      you that the error has occurred.
  701.  
  702.      Below is a sample help text file that we will
  703.      compile together as a tutorial:
  704.  
  705.        #BEGIN LOAD
  706.      
  707.      
  708.              LOAD:
  709.                   Load any file from disk to memory.
  710.                   This allows for editing and viewing.
  711.      #END
  712.      #BEGIN SAVE
  713.      
  714.      
  715.              SAVE:
  716.                   Save the file in memory to diskette
  717.                   for permanent storage.  Remember to
  718.                   do this often so your hard work will
  719.                   not be lost!
  720.      #END
  721.      #BEGIN QUIT
  722.      
  723.      
  724.              QUIT:
  725.                   Quit the world's greatest application
  726.                   and return to the boring, but effective
  727.                   DOS prompt.
  728.      #END
  729.  
  730.  
  731.      This help system is obviously for a menu that
  732.      allows for the choices LOAD, SAVE, or QUIT.
  733.      Larger systems would be formatted the same,
  734.      but include more Topics.  The order of Topics
  735.      doesn't need to comply with the order that
  736.      those Topics appear on the help menu.
  737.  
  738. Creating HELP.HLPs
  739.  
  740.      To run the data file that contains our screen
  741.      displays we need to add the Help command to
  742.      our executable program.  HELPCOMP.EXE creates
  743.      .HLP files for this purpose.  We recommend
  744.      that your .EXE and .HLP filenames contain the
  745.      same first eight characters, and differ only
  746.      by extension.
  747.  
  748.      Let's look at the source code for the BUILDER
  749.      created .EXE that will run the help system
  750.      shown above.  This is a simple implementation
  751.      of the .HLP file MENUHELP.HLP:
  752.  
  753.      USE DIRECT
  754.      Help " Help System ","Menuhelp.hlp",{F1},16,60 @ 4, 10
  755.      Menu Style Blue,White,Red,White,White,Black,Black,White,0,0,1,1
  756.      cls Black on Cyan
  757.      ' Keep displaying the menu until user presses
  758.      {Esc}
  759.      While not cancelled
  760.           ' Run the subroutine Main
  761.           Main
  762.      end
  763.      '
  764.      Sub Main
  765.           DropDown "Simple Title" @ 10,35
  766.                Item "&LOAD"
  767.                Item "&SAVE"
  768.                Item "&QUIT"
  769.                     Exit
  770.           end
  771.      end
  772.  
  773.      This code is self explanatory.  While this
  774.      file is active, moving the highlight (cursor)
  775.      to any selectable item and pressing the
  776.      designated hotkey, {F1} in this case, will
  777.      display a help window, titled "Help System"
  778.      in this case, and use MENUHELP.HLP as its
  779.      data file for screen display.  Note that the
  780.      call to Help in our sample code designates
  781.      the size and placement of the help window.
  782.  
  783. Integrating into a HELP system
  784.  
  785.      Type the following at the command line to
  786.      compile your help text file (MENUHELP.TXT)
  787.      into a help system data file:
  788.  
  789.        HELPCOMP MENUHELP.TXT MENUHELP.HLP
  790.  
  791.      Type the following at the command line to
  792.      compile your BUILDER source code file into an
  793.      executable profram:
  794.  
  795.        BLD MENUHELP.BLD
  796.  
  797.      Now run MENUHELP.EXE and move through your
  798.      menu choices pressing {F1} to view help on
  799.      the highlighted topic.
  800.      
  801.      
  802.  
  803. Linking multiple .OBJs
  804.  
  805.      BUILDER 2.0 allows you to link multiple .OBJs
  806.      together into one .EXE.  Some of the benefits
  807.      of this are:
  808.  
  809.             1) Larger finished programs - instead
  810.                of the 64K .OBJ limit, you can
  811.                create .EXEs up to 1 megabyte.
  812.             2) Reusable .OBJs from one project to
  813.                the next.
  814.             3) Multiple language program creation.
  815.  
  816.      For our purpose here, we'll illustrate the
  817.      linking of two BUILDER created .OBJs, FOO.OBJ
  818.      and FOO1.OBJ.  The code for these files is
  819.      below:
  820.  
  821.      'FOO.BLD
  822.      EXTERNAL SUB SAYHELLO
  823.      CLS
  824.      SayHello
  825.      Say "Back from the other obj"
  826.  
  827.      'FOO1.BLD
  828.      SUB SayHello
  829.           Say "Hello from foo1"
  830.      end
  831.  
  832.      Compile them from the commandline like this:
  833.  
  834.      BLD -c FOO
  835.      BLD -c FOO1
  836.  
  837.      Compiling with the -c switch will stop the
  838.      process after the creation of .OBJ files.
  839.      Link them together with MLINK.EXE from the
  840.      commandline like this:
  841.  
  842.      MLINK FOO+FOO1,,,BLD.LIB
  843.  
  844.      This will create FOO.EXE.  Run it by typing
  845.      FOO at the commandline.  Your screen should
  846.      clear and then display the following:
  847.  
  848.      Hello from foo1
  849.      Back from the other obj
  850.  
  851.      Congratulations, you can now create for
  852.      powerful and flexible BUILDER .EXEs!
  853.  
  854.      
  855.  
  856.      
  857. SUBROUTINE value passing
  858.  
  859.      BUILDER 2.0 allows values to be passed to and
  860.      returned from Subroutines.  Let's modify the
  861.      previous example slightly to pass a string
  862.      for FOO1 to display:
  863.  
  864.      'new improved FOO.BLD
  865.      EXTERNAL SUB SAYHELLO
  866.      CLS
  867.      SayHello "Hello from foo1"
  868.      Say "here we are back in foo"
  869.  
  870.      ' new improved FOO1.BLD
  871.      SUB SayHello string str1
  872.           Say str1
  873.      end
  874.  
  875.      Compile FOO.BLD and FOO1.BLD from the
  876.      commandline as before, using the -c switch.
  877.      Link them again as before.  Run FOO.EXE by
  878.      typing FOO at the commandline.  Your screen
  879.      should clear and then the following should be
  880.      displayed:
  881.  
  882.      Hello from foo1
  883.      here we are back in foo
  884.  
  885.      The example above demonstrated passing a
  886.      value to a subroutine.  Let's return a value
  887.      from a subroutine.  Using the FOO files from
  888.      above make these changes:
  889.  
  890.      ' latest new improved FOO.BLD
  891.      EXTERNAL SUB SAYHELLO
  892.      Integer int1
  893.      CLS
  894.      int1 := SayHello "Hello from foo1"
  895.      Say "here we are back in foo"
  896.      Say "the returned value was ";int1
  897.  
  898.      ' latest new improved FOO1.BLD
  899.      SUB SayHello string str1
  900.           Say str1
  901.           Return 45
  902.      end
  903.  
  904.      Compile and link these files as you have
  905.      before.  Running FOO.EXE should now clear
  906.      your screen and display:
  907.  
  908.      Hello from foo1
  909.      here we are back in foo
  910.      the returned value was 45
  911.  
  912.      That does it for passing values to and from
  913.      subroutines.  This feature can benefit your
  914.      applications dramatically, but requires you
  915.      to adhere strictly to the syntax and formats
  916.      that have been presented.
  917.  
  918.      A more extensive discussion of linking
  919.      BUILDER .OBJs into other languages will be
  920.      available soon on hyperactivity, the
  921.      hyperkinetix BBS.
  922.  
  923.