home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 15 / CDACTUAL15.iso / cdactual / program / pascal / SCNDSIGN.ZIP / README < prev    next >
Encoding:
Text File  |  1987-12-12  |  42.1 KB  |  1,057 lines

  1.  
  2.  
  3.                          ScnDsign Program Version 2.01
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.                                 Program ScnDsign
  13.  
  14.                                By: Iddo L. Enochs
  15.                                403 Cherokee Drive
  16.                                Mc Comb, MS 39648
  17.  
  18.          TABLE OF CONTENTS
  19.  
  20.               INTRODUCTION.......................................... 1
  21.               MAKING A BACK-UP COPY................................. 2
  22.               FILES ON SCNDSIGN DISK................................ 3
  23.               SOME DEFINITIONS...................................... 3
  24.               A QUICK TOUR.......................................... 3
  25.               GETTING STARTED....................................... 4
  26.               CHANGING ATTRIBUTES................................... 6
  27.               CENTERING A LINE...................................... 6
  28.               GRAPHICS AND DUPLICATING CHARACTERS................... 6
  29.               MOVING A BLOCK OF SCREEN.............................. 7
  30.               INSERTING A LINE...................................... 8
  31.               DELETING A LINE....................................... 8
  32.               ENDING THE PROGRAM.................................... 8
  33.               DEFINING VARIABLES.................................... 8
  34.               DELETING A VARIABLE................................... 9
  35.               INSERTING A VARIABLE.................................. 9
  36.               RETURNING FROM VARIABLE DEFINITION TO MAIN PART....... 9
  37.               RECALLING THE VARIABLE INFORMATION.................... 9
  38.               VARIABLE FORMATTING...................................10
  39.               SAVING A SCREEN ON DISK...............................10
  40.               COMPILING AND RUNNING THE SCREEN PROGRAM..............10
  41.               DEFAULT VARIABLE VALUES...............................11
  42.               RESTRICTING VARIABLE ENTRY............................12
  43.               USING VARIABLE ARRAYS IN YOUR PROGRAM.................12
  44.               VERSION...............................................14
  45.               CHANGING THE PROGRAM FOR YOUR COMPUTER................14
  46.               CONCLUSION........................................... 14
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.                          ScnDsign Program Version 2.01
  70.  
  71.  
  72.  
  73.  
  74.          INTRODUCTION:
  75.  
  76.               Welcome to the Program ScnDsign. First of all, I should
  77.          tell you a few things about the program and a few things that
  78.          the program is not. One of the tedious parts of programming
  79.          is the design and lay-out of screens for input of data. This
  80.          program will enable you to do that with a minimum of effort.
  81.          You can design the screen just as you want it to appear in
  82.          your program. You can specify where and what type of
  83.          variables you wish to enter when running the program and
  84.          ScnDsign will take care of the details for you. The program
  85.          will then generate the source code in Turbo Pascal which you
  86.          can then compile and run. The compiled program will lay out
  87.          your screen on the console and then call forth the variable
  88.          information you have placed in your program. The screens will
  89.          also be saved on disk in condensed form so that they can be
  90.          recalled at a later time.
  91.  
  92.               This program is distributed under the Freeware concept.
  93.          That is, you are free to use it without charge and to make
  94.          copies for anyone else. If you find it useful, please send a
  95.          contribution to the address below. The suggested amount is
  96.          $25.00. However, any amount will be appreciated.
  97.  
  98.                                  Iddo L. Enochs
  99.                                403 Cherokee Drive
  100.                                Mc Comb, MS 39666
  101.  
  102.               Please send a copy of this document with the program.
  103.          Thanks for making the Freeware program work.
  104.  
  105.               To experienced computer users I apologize if this
  106.          documentation seems a little pedestrian. However, I have
  107.          written it with the beginner in mind hoping I can save him
  108.          some of the grief I well recall when I was trying to
  109.          understand a program the instructions to which were seemingly
  110.          written in Swahili.  I have also tried to keep the computer
  111.          jargon to a minimum.
  112.  
  113.               In order to use the program, it is necessary that you be
  114.          familiar with Turbo Pascal by Borland International and know
  115.          how to edit, compile and run pascal program files with this
  116.          program.
  117.  
  118.               The program is written in Turbo Pascal and generates
  119.          Turbo Pascal code for use in the program you are creating.
  120.          The program is written specifically for the IBM PC but should
  121.          work with most compatibles. Version 2.01 is designed to work
  122.          with both the monochrome adapter and the graphics adapter
  123.          with a monochrome monitor.  The program checks to see which
  124.          adapter is installed and then adjusts itself automatically.
  125.          Earlier versions worked only with the monochrome adapter.
  126.  
  127.  
  128.  
  129.                                      Page 1
  130.  
  131.  
  132.  
  133.  
  134.  
  135.                          ScnDsign Program Version 2.01
  136.  
  137.  
  138.  
  139.          MAKING A BACK-UP COPY:
  140.  
  141.               To begin with, make one or more back-up copies of your
  142.          program disk. You can do this if you have only one disk drive
  143.          in the following manner.
  144.               1. Place your DOS diskette in your drive and at the DOS
  145.                  prompt of A>_ type
  146.  
  147.                          FORMAT B:/S
  148.  
  149.                  and press [Enter].
  150.                  The message    "Insert new diskette for drive B:
  151.                                  and strike any key when ready"
  152.                  will appear.
  153.               2. Remove you DOS diskette and put a blank disk into the
  154.                  drive and strike any key. DOS will format your disk.
  155.                  Using the /S option causes DOS to install DOS system
  156.                  files on the diskette so that it can be used without
  157.                  having to switch to a separate DOS diskette from time
  158.                  time.
  159.               3. Follow the instructions on the screen until you get
  160.                  another DOS prompt.
  161.               4. Then insert the ScnDsign disk in your drive and type
  162.  
  163.                          COPY *.* B:
  164.  
  165.                  and press [Enter].
  166.               5. Follow the directions with the understanding that the
  167.                  ScnDsign disk is the scource disk and the newly
  168.                  formatted disk is the target disk.
  169.               6. All of the files on your ScnDsign disk will now be
  170.                  copied to the newly formatted disk.
  171.  
  172.  
  173.               With two disk drives the copying process is slightly
  174.          simpler.
  175.  
  176.               1. With your DOS disk in drive A and a blank disk in
  177.                  drive B ,at the DOS prompt of A>_ type
  178.  
  179.                         FORMAT B:/S
  180.  
  181.                  and press [Enter].
  182.               2. Follow the instructions until you get another DOS
  183.                  prompt of A>_.
  184.               3. Then insert the ScnDsign disk in drive A and type
  185.  
  186.  
  187.  
  188.                          COPY *.* B:
  189.  
  190.                  and press [Enter].
  191.               4. All of the files on your ScnDsign disk will now be
  192.                  copied to the newly formatted disk in drive B.
  193.  
  194.  
  195.                                      Page 2
  196.  
  197.  
  198.  
  199.  
  200.  
  201.                          ScnDsign Program Version 2.01
  202.  
  203.  
  204.  
  205.  
  206.          FILES ON THE SCNDSIGN DISK:
  207.  
  208.               You will find the following files on your ScnDsign disk.
  209.  
  210.  
  211.               1. ScnDsign.pas  This is the Pascal scource code file
  212.                  for the ScnDsign program.
  213.               2. ScnDsign.com  This is the compiled program for
  214.                  designing screens.
  215.               3. Help.scn   This is the help screen (designed with the
  216.                  ScnDsign program) which is used to give you helpful
  217.                  information when using the ScnDsign program.
  218.               4. Var.scn   This is a screen used in the Define
  219.                  Variable part of the program.
  220.               5. Demo.scn  This is a demonstration screen to give you
  221.                  an example of the screens you can design.
  222.               6. General.Inc  This file is used with the program file
  223.                  which is generated by the ScnDsign program. This file
  224.                  will be "Included" at the time the program file (the
  225.                  one generated by the ScnDsign program) is compiled.
  226.                  It contains the various variable definitions,
  227.                  procedures, etc. which will be needed in the program
  228.                  file. Don't worry about this file at this time.
  229.  
  230.          SOME DEFINITIONS:
  231.  
  232.               Source code : A program written is some language such as
  233.                             pascal to be compiled & run.
  234.               Current drive : The default drive or the drive that DOS
  235.                               uses unless directed to do otherwise.
  236.               Work Screen : The screen you are designing.
  237.  
  238.          A QUICK TOUR:
  239.  
  240.               If you would like a quick tour of the program without
  241.          all of the bells and whistles, just continue with this
  242.          paragraph. If you want to learn most of the features while
  243.          designing a demonstration screen, then skip to GETTING
  244.          STARTED.
  245.  
  246.               With the ScnDsign.com, Help.scn and the Var.scn files
  247.          all on the default drive, type "ScnDsign" (without the
  248.          quotes) and press [Enter]. After the Help and Var screens are
  249.          read into memory, follow instructions by pressing any key to
  250.          clear the screen. Then press the Escape key twice to display
  251.          the Help screen which contains most of the information you
  252.          will need to run the program.
  253.  
  254.               Press any key to get back to the main part of the
  255.          program. Then move to approximately the center of the screen
  256.          and type the following:
  257.  
  258.  
  259.  
  260.  
  261.                                      Page 3
  262.  
  263.  
  264.  
  265.  
  266.  
  267.                          ScnDsign Program Version 2.01
  268.  
  269.  
  270.  
  271.                        Demonstration
  272.  
  273.                        String Entry :
  274.  
  275.               Then press the F8 key to get to the DefineVariable part
  276.          of the program. Define your variable by naming it Stringvar
  277.          and then making it a string variable type. You will then be
  278.          taken to the work screen (the screen you have just laid out)
  279.          and asked to position the variable. Move the cursor to the
  280.          immediate right of the colon and press F1. Then move the
  281.          cursor 7 or 8 more positions to the right and press F1 again.
  282.          Then press the space bar to go back to the variable screen.
  283.          Then press F10 to return to the main part of the program.
  284.  
  285.               Your screen should now look like this with the ones in
  286.          reverse video:
  287.  
  288.                        Demonstration
  289.  
  290.                        String Entry :1111111111
  291.  
  292.               The ones signify that this is variable number one.
  293.  
  294.               Now press F6 in order to generate the pascal scource
  295.          file for your program. When you are asked for a name of your
  296.          screen, reply with the name Demo10. Now press F10 in order to
  297.          leave the ScnDsign program. You will be given a chance to
  298.          define your variables and save your screen but, since you
  299.          have already done so, ignore this.
  300.  
  301.               A pascal program named Demo10.pas will have been
  302.          generated which will display the screen you designed and will
  303.          call for the string input you specified. A Demo10.scn file
  304.          and a Demo10.var file will also be generated by the program.
  305.          Just ignore the latter two files for the time being.
  306.  
  307.               Now get into Turbo Pascal and compile and run the Demo10
  308.          program. Be sure that you have the General.inc file on the
  309.          current drive when you compile the Demo10.pas program since
  310.          this file will be included at the time of compilation.
  311.  
  312.               As you can see, designing a screen will take just a
  313.          fraction of the time it normally would.
  314.  
  315.               Use your Help screen to learn of the other features of
  316.          the program or read further in these instructions.
  317.  
  318.          GETTING STARTED:
  319.  
  320.               Without further ado let's get started. I will take you
  321.          through a brief session using most of the features of
  322.          ScnDsign and then cover some of the finer points later on.
  323.  
  324.               The files ScnDsign.com, Help.scn, and Var.scn must all
  325.  
  326.  
  327.                                      Page 4
  328.  
  329.  
  330.  
  331.  
  332.  
  333.                          ScnDsign Program Version 2.01
  334.  
  335.  
  336.  
  337.          be on your current drive before beginning.  To start the
  338.          program, just type SCNDSIGN and [Enter] at the DOS prompt
  339.          with the working copy of your program in drive A.  The
  340.          program will load itself and will then advise you that it is
  341.          reading the two screen files (Help.scn and Var.scn) into
  342.          memory. After the screens are read into memory, the message
  343.          "Press the Escape twice for help" will appear on the screen.
  344.          Also, the message "Press any key to continue" will appear.
  345.          Press any key (the spacebar for example) and the screen will
  346.          go blank. You are ready to begin the session.
  347.  
  348.               To see how the Help screen is activated, press the
  349.          Escape key twice and the Help screen will appear instantly.
  350.          You will notice that there is no disk access. The Help screen
  351.          is merely moved from one area of memory to the screen. The
  352.          Help screen should be pretty well self-explanatory and covers
  353.          the functions when designing the screen and when in the Move
  354.          Block procedure part of the program (more about that later).
  355.          Incidentally,the Help screen cannot be called up later on
  356.          when you get into the Define Variable part of the program,
  357.          but it is not needed then as the Var.scn being used at that
  358.          time has all of the help information you will need.
  359.  
  360.               The Help screen is a good example of the type of screen
  361.          you can quickly and easily design with the ScnDsign program.
  362.          Notice the use of intense characters at some points and the
  363.          use of the blinking B, both of which are easy to make as you
  364.          will soon see.
  365.  
  366.               The IBM screen occupies a total of 4000 bytes of memory
  367.          since there are a total of 25 lines times 80 columns on the
  368.          screen, each of which position occupies one byte of memory,
  369.          or a total of 2000 bytes and a like amount of bytes of
  370.          Attributes which go with each of the screen positions.
  371.          However, if you check the Help.scn file you will notice that
  372.          it occupies only 1335 bytes of memory on the disk. This is
  373.          because the screen information is in condensed form when it
  374.          is saved to disk by the ScnDsign program.
  375.  
  376.               You might like to see one other example of a screen
  377.          designed with this program before proceeding with  this
  378.          session.  If so, press any key(the space bar will do) to get
  379.          back to the main part of the program. Then use F5 to display
  380.          a screen from a disk file. You will be told that proceeding
  381.          will overwrite what may be on the screen at the time and
  382.          asked if you do wish to proceed.  Answer with a "Y".  You
  383.          will be asked for the name of the screen filename you wish to
  384.          display. Respond with the name "Demo". The Demo screen should
  385.          appear on your screen. Again notice the use of intense
  386.          characters at some positions on the screen and the use of a
  387.          border around a portion of the screen.
  388.  
  389.               Now you can clear the Demo screen in order to start
  390.          designing your very own screen. An easy way to clear the
  391.  
  392.  
  393.                                      Page 5
  394.  
  395.  
  396.  
  397.  
  398.  
  399.                          ScnDsign Program Version 2.01
  400.  
  401.  
  402.  
  403.          screen is to position the cursor on the topmost line on which
  404.          there are characters and to then press F3 which will delete
  405.          that line. Continue to hold F3 down and successive lines will
  406.          be deleted until the screen is cleared.  You can then begin
  407.          using the program to design the screen as you see fit.  The
  408.          four arrow keys work just as they normally do; that is, they
  409.          move the cursor around the screen without destroying what is
  410.          on the screen.  The Enter key acts as a line feed.  The
  411.          Backspace key backs up the cursor and deletes the character
  412.          to the left of the cursor.  The Delete key deletes the
  413.          character at the cursor position and moves the line to the
  414.          right of the cursor one position to the left.  The Insert key
  415.          toggles the program between the insert mode and the overwrite
  416.          mode. When in insert mode the cursor will be enlarged so that
  417.          you will be aware the insert mode is on.
  418.  
  419.          CHANGING ATTRIBUTES:
  420.  
  421.               For an exercise in screen design, lay out the screen
  422.          approximately as shown below, placing it anywhere on the
  423.          screen.  (We will use the Move Block part of the program to
  424.          center it later on)  Before typing the title "Demonstration
  425.          Screen", use F4 to change the Attribute mode to intense. When
  426.          you do so, a menu will appear on the screen giving you the
  427.          option of selecting various Attribute options.  Select number
  428.          five  by entering the numeral five and pressing the [Enter]
  429.          key.  You will then notice that selection number five will
  430.          intensify on the screen indicating that this option has been
  431.          selected.  Then select option number six in order to return
  432.          to the program.  Your Work Screen will instantly reappear.
  433.          From now until you change Attribute again, what you write on
  434.          the screen will appear in the intensified form.
  435.  
  436.  
  437.                      Demonstration Screen
  438.  
  439.  
  440.                 This is an Integer Variable     :
  441.                 This is a Real Variable         :
  442.                 This is a String Variable       :
  443.                 This is a Boolean Variable      :
  444.  
  445.  
  446.          CENTERING A LINE:
  447.  
  448.               With the cursor on the line where you have just written
  449.          "Demonstration Screen", use F1 to center the line on the
  450.          screen. Change Attribute to Normal before completing the rest
  451.          of the screen.
  452.  
  453.          GRAPHICS AND DUPLICATING CHARACTERS:
  454.  
  455.               Now we will place a border around the screen you have
  456.          designed.  Place the cursor at the position you want the
  457.  
  458.  
  459.                                      Page 6
  460.  
  461.  
  462.  
  463.  
  464.  
  465.                          ScnDsign Program Version 2.01
  466.  
  467.  
  468.  
  469.          upper left corner of your border, hold down the Alternate key
  470.          with your left hand and enter the numerals 201 using the
  471.          numerical pad.  Then release the Alternate key.  The ASCII
  472.          character 201 should appear on the screen (a double-lined
  473.          corner emblem).  Now, at the screen position immediately to
  474.          the right of this last character, enter the ASCII character
  475.          205 in like manner.  It would be laborious indeed if you had
  476.          to enter each character in the same manner all around the
  477.          border. That is where the Duplicate Character facilities come
  478.          in handy.  Position the cursor under the last character you
  479.          entered (two horizontal lines). Then press F7. If you
  480.          continue to hold the F7 key down, these horizontal lines will
  481.          be duplicated across the screen. When you get to the point
  482.          where the upper right corner of the border should be, enter
  483.          the ASCII character 187. Immediately below this character,
  484.          enter the character 186 for two vertical lines.  Position the
  485.          cursor under this character and duplicate downward by using
  486.          the Shift and the F7 keys. That is, hold the shift and the F7
  487.          keys down at the same time. Using similar methods, you can
  488.          now complete the left and lower sides of the of the border.
  489.          The ASCII values for the lower left and lower right corners
  490.          of the double lined border are 200 and 188, respectively.
  491.  
  492.               In order to do more graphic work you might wish to get
  493.          access to all of the  ASCII Character codes.  They are in
  494.          Appendix G of the IBM Basic Manual and in the Sidekick
  495.          Program by Borland International among other places.  You can
  496.          then use the Alternate key together with the numeric pad to
  497.          generate any of these characters you may wish. Remember that
  498.          you can only duplicate characters downward and to the right
  499.          but this is no impediment. Just start at the top or to the
  500.          left of the line of characters you wish to make.
  501.  
  502.          MOVING A BLOCK OF SCREEN:
  503.  
  504.               If your border is not quite centered on the screen, we
  505.          will now use the Move Block part of the program to center it.
  506.          Press the F9 key. This gets you into the Move Block part of
  507.          the program. You will be instructed to position the cursor
  508.          at the upper left corner of the block to be moved and to then
  509.          press F1. Do so. You will then be instructed to move the
  510.          cursor to the lower right corner of the block and to then
  511.          again press F1. Do so. Reverse video will then cover the
  512.          block you have outlined.  You may then use the four arrow
  513.          keys to move the block around the screen.  Do not worry about
  514.          running off the screen as the block movement will stop when
  515.          the block runs into the limits of the screen.  One note of
  516.          caution though; the movement of the block will obliterate
  517.          anything in it's path. Now center the block you have outlined
  518.          by using the four arrow keys. To return to the main part of
  519.          the program, press F10. If you care to do so, you may then
  520.          re-position the writing inside the border by using the method
  521.          just outlined.
  522.  
  523.  
  524.  
  525.                                      Page 7
  526.  
  527.  
  528.  
  529.  
  530.  
  531.                          ScnDsign Program Version 2.01
  532.  
  533.  
  534.  
  535.          INSERTING A LINE:
  536.  
  537.               To insert a line, merely use F2. Be aware that if there
  538.          are characters on line 25(the last line on the screen), these
  539.          characters will be lost when a new line is inserted.
  540.  
  541.          DELETING A LINE:
  542.  
  543.               Deleting a line is done with F3.
  544.  
  545.  
  546.          ENDING THE PROGRAM:
  547.  
  548.               To end the program you press the F10 key. However, don't
  549.          do so until you have defined your variables. When you do end
  550.          the program, you will be given the opportunity to save the
  551.          work screen and to define your variables if you have not
  552.          already done so.
  553.  
  554.          DEFINING VARIABLES:
  555.  
  556.               To define the variables now that you have designed you
  557.          screen, press F8. The Var.scn will appear almost immediately.
  558.          The instructions and explanations on the Var.scn should
  559.          enable you to use this part of the program without much
  560.          further help.
  561.  
  562.               At position one in the variable table, enter the name of
  563.          your first variable, IntVar for example. You may use as many
  564.          as ten characters in the variable name. When prompted for the
  565.          type of variable, enter I for integer.  You will immediately
  566.          be taken from the Var.scn to the screen you have just
  567.          designed for positioning the place on the screen at which the
  568.          IntVar variable will be entered.  Move the cursor immediately
  569.          to the right of the colon after where the screen shows "This
  570.          is an Integer Variable". Then press F1 to tell the program
  571.          that this is where the variable entry point will start. A
  572.          single digit (the last digit of the variable number) will
  573.          appear in reverse video.  You will then be prompted to
  574.          position the cursor at the point where the entry point ends
  575.          and to press F1 again.  The rest of the variable space will
  576.          be filled with digits. To return to the variable screen,
  577.          merely press any key such as the space bar. If you want a
  578.          variable with a length of one , you can enter F1 the second
  579.          time at the same position you entered the first F1.
  580.  
  581.               There are a few things to notice about this part of the
  582.          program. First of all, you can position the variable where
  583.          there are characters on the screen but these characters will
  584.          be overwritten by the variable. This feature was included
  585.          purposefully so that you may undeline the area in which a
  586.          variable is to be entered if you so wish. Second, the cursor
  587.          will not move off the line where the first F1 is entered.
  588.          Third, the second F1 will not be accepted unless the cursor
  589.  
  590.  
  591.                                      Page 8
  592.  
  593.  
  594.  
  595.  
  596.  
  597.                          ScnDsign Program Version 2.01
  598.  
  599.  
  600.  
  601.          is at or to the right of the first F1 position.
  602.  
  603.               You may select one of four types of variables; integer,
  604.          real, string and boolean. If you select boolean, you will be
  605.          unable to move the cursor after entering the first F1 since a
  606.          boolean variable has a length of one. The boolean variable
  607.          entry will accept only the letters Y or N.
  608.  
  609.               In like manner, name and position the other three
  610.          variables using the names RealVar, StrVar, and BolVar for
  611.          example.  Also specify that variable two is a real variable,
  612.          variable three is a string variable, and variable four is a
  613.          boolean variable. You may define up to total of eighty
  614.          variables.
  615.  
  616.               To amend a variable entry, merely position the cursor at
  617.          that variable position in the Variable table using the up and
  618.          down arrow keys. If you want to change the name of the
  619.          variable, type in the new name and then proceed just as you
  620.          normally do. If you don't wish to change the name, just hit
  621.          the Enter key and then proceed just as you normally do.
  622.  
  623.          DELETING A VARIABLE:
  624.  
  625.               To delete a variable, use F3 which is the same key you
  626.          used to delete a line in the main part of the program.
  627.  
  628.          INSERTING A VARIABLE:
  629.  
  630.               To insert a variable at a particular position, position
  631.          the cursor at that position in the variable table by using
  632.          the up and down arrow keys and then enter F2. This is the
  633.          same key used in the main part of the program to insert a
  634.          line.  A blank will be inserted in the variable table at that
  635.          point so that you may then define the variable as you see
  636.          fit.
  637.  
  638.          RETURNING FROM VARIABLE DEFINITION TO MAIN PART OF PROGRAM:
  639.  
  640.               To return to the main part of the program, press the F10
  641.          key.
  642.  
  643.          RECALLING THE VARIABLE INFORMATION:
  644.  
  645.               While you are in the Defining Variable part of the
  646.          program, you can recall the variable information which may
  647.          have been saved earlier by pressing F5. You will be prompted
  648.          for the name of the file containing this information. Be sure
  649.          to specify the drive designation if different from the
  650.          current drive.  After the file name is properly specified,
  651.          the varible information will be read into the variable table.
  652.  
  653.          VARIABLE FORMATTING:
  654.  
  655.  
  656.  
  657.                                      Page 9
  658.  
  659.  
  660.  
  661.  
  662.  
  663.                          ScnDsign Program Version 2.01
  664.  
  665.  
  666.  
  667.               The program generated by ScnDsign will write real
  668.          variables to the screen with two digits after the decimal
  669.          point. This can be changed easily by editing the Pascal file
  670.          which the ScnDsign program generates. Just change the third
  671.          parameter in the Real_Entry procedure from 2 to the number of
  672.          decimals you want.
  673.  
  674.          SAVING A SCREEN ON DISK:
  675.  
  676.               If you don't have any more work to do on your screen, it
  677.          can be saved to disk. To save a screen to disk file, use F6.
  678.          You will be prompted for the file name. Name the file "Demo2"
  679.          for the screen you have just designed. Be sure to include the
  680.          drive designation if the drive you wish to use is not the
  681.          current drive. Do not include the extension since the
  682.          extension .scn will automatically be added. The Help.scn and
  683.          Var.scn are examples of screen file names. Also, remember
  684.          that if you use the name of an existing file name, that file
  685.          will be overwritten.
  686.  
  687.               When you save your program, three files will be
  688.          generated. The first is a file with the extension scn. This
  689.          is a file containing the information on the screen you have
  690.          designed. The information is in condensed form. This file is
  691.          used by the ScnDsign program to read in a screen when you
  692.          wish to recall a screen you have saved at an earlier date.
  693.  
  694.               The second file is a file with the extension var
  695.          containing the variable information from the variable table.
  696.          You can later use this file to recall the variable table
  697.          information.
  698.  
  699.               The two files mentioned above are used solely for
  700.          recalling the screen and variable information when using the
  701.          ScnDsign program again. If you don't need to recall this
  702.          information, these two files can be deleted.
  703.  
  704.               The third file generated is the source code file with
  705.          the extension of pas which can be compiled and run in order
  706.          to display the screen you have designed and to then read in
  707.          the variable information called for by the screen program.
  708.  
  709.          COMPILING AND RUNNING THE SCREEN PROGRAM:
  710.  
  711.               Now that you have designed your screen and have
  712.          generated a program file to use the screen and variable
  713.          information, we will see how all of this is put together. The
  714.          Demo2.pas file that was generated by the program will have a
  715.          line which reads "{$I General.inc}". This is a directive to
  716.          the compiler to include the General.inc file at this point
  717.          when the Demo2.pas file is being compiled. You might wish to
  718.          read the chapter in the Turbo Pascal reference manual on
  719.          Including files if you wish further explanation. It is
  720.          imperative that you have the General.inc file on the current
  721.  
  722.  
  723.                                     Page 10
  724.  
  725.  
  726.  
  727.  
  728.  
  729.                          ScnDsign Program Version 2.01
  730.  
  731.  
  732.  
  733.          disk drive so that it can be included. As mentioned above,
  734.          the General.inc file contains the general information, types,
  735.          procedures ,etc. that will be needed by the program you have
  736.          generated with the ScnDsign program. You might wish to call
  737.          up the General.inc file with your editor in order to look it
  738.          over. It contains some useful procedures which might be of
  739.          use to you in other programs. Now compile the Demo2.pas file
  740.          and run it.  The program will delineate your screen on the
  741.          console. It then will proceed to read in the four variables
  742.          at the appointed positions on the screen accepting only
  743.          appropiate characters at the points the variables are read on
  744.          your screen.
  745.  
  746.          DEFAULT VARIABLE VALUES:
  747.  
  748.               You will notice that the Demo2.pas program sets the
  749.          initial values of the all but the boolean variables in the
  750.          program.  The numeric variables are set to zero and the
  751.          string variables are set to null values. This is called
  752.          initializing in computer jargon.  This is done for a couple
  753.          of reasons at least one of which could be important to you in
  754.          designing your program.
  755.  
  756.               First of all, if you wish not to make entries for
  757.          certain variables, you may just hit the Enter key at the
  758.          point where the variable is to be entered when running the
  759.          program. If the initial values had not been set when you hit
  760.          the Enter key, you might end up with some garbage for a
  761.          variable value.
  762.  
  763.               Of more importance is the way the program works if you
  764.          wish to use default values other than zero or null values for
  765.          certain of your variables.  Let us assume that you have
  766.          thirty variables on your screen and twenty-five of these
  767.          variables have default(other than zero or null) values which
  768.          are used most of the time when running the program. In order
  769.          to save the person who runs the program a great deal of time
  770.          you can edit the program with your Turbo Pascal Editor and
  771.          set the initial values to these default values. Now, when
  772.          someone runs the program and comes to a variable entry point,
  773.          he or she can merely hit the Enter key if that variable
  774.          default value is acceptable. The three procedures in the
  775.          General.inc file which are used for accepting integer, real
  776.          and string variables are designed so that hitting the Enter
  777.          key will not change the default value of that particular
  778.          variable.
  779.  
  780.               To give you and example of this, go back and edit your
  781.          Demo2.pas program so that the the IntVar, RealVar, and StrVar
  782.          variables have default values of 99, 677.56 and
  783.          "Demo", respectively. Now run the program and you will see
  784.          that you can merely hit the Enter key at the point these
  785.          variables are to be entered and the default values will be
  786.          accepted.
  787.  
  788.  
  789.                                     Page 11
  790.  
  791.  
  792.  
  793.  
  794.  
  795.                          ScnDsign Program Version 2.01
  796.  
  797.  
  798.  
  799.  
  800.               As I am sure you understand, the program generated by
  801.          the ScnDsign program, such as the Demo2.pas program, is
  802.          merely the nucleus of the program you will end up with.
  803.          You can add to this program, incorporate it into another
  804.          program, elaborate on it, or rearrange it as you see fit.
  805.  
  806.          RESTRICTING VARIABLE ENTRY:
  807.  
  808.               As you have seen, the program generated by ScnDsign will
  809.          accept only the characters appropriate for the type variable
  810.          being entered at that point. Only numerals and a decimal
  811.          point will be accepted for real variables, as an example.
  812.          However, suppose that you wish to further restrict the entry
  813.          to only certain values.
  814.  
  815.               I thought of designing ScnDsign so that this could be
  816.          accomplished, but the effort hardly seemed worth the candle.
  817.          If you wish to restrict certain of your variables to definite
  818.          values, I would suggest doing so in the following manner.
  819.  
  820.               Assume the you wish to restrict your IntVar entry to any
  821.          value from 1 through 50 or to 75. Edit the code in your
  822.          program file so you have a set as shown and the variable
  823.          enrtry routine will end up looking something like the example
  824.          below.  The rest of the program is omitted for the sake of
  825.          simplicity.
  826.  
  827.          Const
  828.             OKset : set of byte = [0..50,75];
  829.  
  830.                  Repeat
  831.                     GotoXY(52,10);
  832.                     Integer_Entry(IntVar,5);
  833.                     if IntVar not (in OKset) then  write(^G);
  834.                  until IntVar in OKset;
  835.  
  836.               Now your program will not proceed until the proper value
  837.          is entered for IntVAr and will beep each time that an
  838.          improper value is entered. Incidentally, sets won't work with
  839.          real variables, so you will be obliged to use relational
  840.          operators to restrict real variables to certain ranges.
  841.  
  842.               I'm sure you get the idea that with the ScnDsign program
  843.          as a starter, you can make your final program as elaborate as
  844.          you wish.
  845.  
  846.          USING VARIABLE ARRAYS IN YOUR PROGRAM:
  847.  
  848.               I have used some screen design programs which required
  849.          you to define each element of an array, a laborious job.  If
  850.          your program requires an array of variables , it seems easier
  851.          to me to define one element of the array and to then edit
  852.          your program code to take care of the final version of the
  853.  
  854.  
  855.                                     Page 12
  856.  
  857.  
  858.  
  859.  
  860.  
  861.                          ScnDsign Program Version 2.01
  862.  
  863.  
  864.  
  865.          array.
  866.  
  867.               As an example, let us assume the your program will
  868.          require data entry something like that shown below.
  869.  
  870.          Emp. Number    Last Name    Salary    Department
  871.          -------------------------------------------------
  872.               344         Smith    12500.00   Maintenance
  873.               877         Jones    16750.00    Accounting
  874.               463        Devers    22500.00   Procurement
  875.               184      Johnston    13000.00    Accounting
  876.               (assume there are 16 more lines of data)
  877.  
  878.               You should design your screen just as you would normally
  879.          do. When you get to the Variable Definition part of the
  880.          program, treat the program as if the first line of data entry
  881.          were the only line. Part of the code generated would look
  882.          something like the following. I have omitted the code which
  883.          initializes the variables and writes these initial values to
  884.          the screen. This part of the code can be omitted in the
  885.          edited version since there will be no need for initial values
  886.          in this type program.
  887.  
  888.          Var
  889.             EmpNum : integer;
  890.             Salary : real;
  891.             LastName,Dept : AnyString;
  892.  
  893.          Begin
  894.             GotoXY(6,3);
  895.             Integer_Entry(EmpNum,5);
  896.             GotoXY(17,3);
  897.             String_Entry(LastName,10);
  898.             GotoXY(30,3);
  899.             Real_Entry(Salary,9);
  900.             GotoXY(45,3);
  901.             String_Entry(Dept,12);
  902.          end.
  903.  
  904.               Now that you have the basic information of where the
  905.          variables are placed on the first line of data entry, it is a
  906.          relatively simple matter to edit the program changing the
  907.          variables to arrays so that the program takes care of all of
  908.          the elements of the array. Your newly edited program would
  909.          look something like the following.
  910.  
  911.          Var
  912.               EmpNum      : array[1..20] of integer;
  913.               Salary      : array[1..20] of real;
  914.               LastName    : array[1..20] of AnyString;
  915.               kount       : integer;
  916.  
  917.          Begin
  918.               for kount := 1 to 20 do
  919.  
  920.  
  921.                                     Page 13
  922.  
  923.  
  924.  
  925.  
  926.  
  927.                          ScnDsign Program Version 2.01
  928.  
  929.  
  930.  
  931.                  begin
  932.                     GotoXY(6,kount + 2);
  933.                     Integer_Entry(EmpNum[kount],5);
  934.                     GotoXY(17,kount + 2);
  935.                     String_Entry(LastName[kount],10);
  936.                     GotoXY(30,kount + 2);
  937.                     Real_Entry(Salary[kount],9);
  938.                     GotoXY(45,kount + 2);
  939.                     String_Entry(Dept[kount],12);
  940.                  end;
  941.          end.
  942.  
  943.               Now, the program will ask for all 20 lines of data
  944.          before ending. Notice that the program now tells the cursor
  945.          to go to line number kount + 2 rather than line 3. This is
  946.          because kount starts out with one in the first iteration so
  947.          the cursor still starts out on line three. Incidentally,
  948.          don't use the variable "count" for iteration as it is used in
  949.          the General.inc file and there could be interaction.
  950.  
  951.               Again, a portion of the code was left out for the sake
  952.          of clarity. I hope, however, you can see that the program
  953.          generated by ScnDsign is the starting point, and that with a
  954.          little extra effort you can provide for a large amount of
  955.          data entry with no great amount of effort.
  956.  
  957.          VERSION:
  958.  
  959.               This is version 2.01 of ScnDsign. The first version of
  960.          the program portrayed a screen on the console by reading the
  961.          screen imvormation directly from a condensed file into
  962.          memory. However, this method proved somewhat slower than the
  963.          method used in version 2.0  which consisted of writing to the
  964.          console by generating and compiling pascal code. Those of you
  965.          interested in the first method can find both the method of
  966.          saving the screen information and the method of reading this
  967.          information into screen memory in the ScnDsign.pas file
  968.          contained on this disk.
  969.  
  970.          CHANGING THE PROGRAM FOR YOUR COMPUTER:
  971.  
  972.               Previous versions of this program were written solely
  973.          for the IBM PC with a monochrome monitor. This made it
  974.          necessary for you to amend the source code if you used a
  975.          graphics adapter or a color monitor. However, this version
  976.          adjusts itself automatically to the type monitor and adapter
  977.          you are using.
  978.  
  979.          CONCLUSION:
  980.  
  981.               There you have it. The program can and will save you a
  982.          great amount of time in designing screens and providing for
  983.          data entry. It could have been made much more elaborate, but
  984.          an effort has been made to keep it simple with the
  985.  
  986.  
  987.                                     Page 14
  988.  
  989.  
  990.  
  991.  
  992.  
  993.                          ScnDsign Program Version 2.01
  994.  
  995.  
  996.  
  997.          understanding that frills can be added by editing the basic
  998.          program you get. Although I have tested the program at
  999.          length, please understand that I cannot be responsible for
  1000.          any liability for damages or lost profits which may result
  1001.          from the use of this product.
  1002.  
  1003.  
  1004.  
  1005.  
  1006.  
  1007.  
  1008.  
  1009.  
  1010.  
  1011.  
  1012.  
  1013.  
  1014.  
  1015.  
  1016.  
  1017.  
  1018.  
  1019.  
  1020.  
  1021.  
  1022.  
  1023.  
  1024.  
  1025.  
  1026.  
  1027.  
  1028.  
  1029.  
  1030.  
  1031.  
  1032.  
  1033.  
  1034.  
  1035.  
  1036.  
  1037.  
  1038.  
  1039.  
  1040.  
  1041.  
  1042.  
  1043.  
  1044.  
  1045.  
  1046.  
  1047.  
  1048.  
  1049.  
  1050.  
  1051.  
  1052.  
  1053.                                     Page 15
  1054.  
  1055.  
  1056.  
  1057.