home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / PASCAL / GET10.ZIP / GETDEMO.DOC < prev    next >
Encoding:
Text File  |  1988-11-09  |  10.3 KB  |  252 lines

  1.  
  2.  
  3.  
  4.         GETDEMO
  5.  
  6.         This program is intended to demonstrate the use of some GET
  7.         procedures and will, I hope, illustrate how easy it is to use
  8.         them in concert to get a screenful of information.
  9.  
  10.  
  11.         What's it all about?
  12.  
  13.         The GET procedures take the grunt work out getting information
  14.         from the screen. You simply say what you want, where you want to
  15.         get it from, and leave the rest to the GET procedure of your
  16.         choice. Several GET procedures can be used together to make a
  17.         form; with only a little extra work your form can include display
  18.         only, calculated and password fields.
  19.  
  20.  
  21.         Moving about the screen
  22.  
  23.         Navigation about the form is very straightforward. The up and
  24.         down arrow keys may be used to take you to the previous and next
  25.         fields respectively. Control Home takes you to the first field,
  26.         and Control End takes you to the last field. The <return> and
  27.         <tab> keys function like the down arrow and shift <tab> works
  28.         like the up arrow key. Practise moving about the form using these
  29.         keys.
  30.  
  31.         Now try the left and right arrow keys. These can also take you
  32.         about the form, however they are used for moving within string
  33.         fields as well for moving about the field. The horizontal arrow
  34.         keys don't have to take you to the same fields as the vertical
  35.         arrow keys but they do in this demonstration. Note the function
  36.         of the Home and End keys when the cursor is in a string field.
  37.  
  38.         As you move from field to field you'll notice certain things.
  39.  
  40.         1. The colour of the current field is different from that of
  41.            other fields. This is simply to draw attention to the field,
  42.            so it is easy to find on the screen. The variable FieldCursor
  43.            controls the value of the colour displayed for the current
  44.            field. If FieldCursor has the value 0 then the colour of the
  45.            field remains unchanged.
  46.  
  47.         2. In string fields the blinking cursor disappears and is
  48.            replaced by a solid block of colour. This "video (attribute)
  49.            cursor" (as opposed to a real one) is used to make a non-
  50.            blinking cursor, which I happen to prefer. It is accomplished
  51.            by changing the attribute byte of the appropriate screen
  52.            location. You don't have to use this sort of cursor of course,
  53.            but the option is there. Pressing the Insert key will toggle
  54.            the display of the normal underline cursor on or off,
  55.            depending on its previous state. A blinking underline cursor
  56.            means that overwrite mode is on. A block cursor, blinking or
  57.            non-blinking, means that insert mode is on.
  58.  
  59.            In some string fields you'll notice that the underline cursor
  60.            is forced on all the time, pressing the Insert key has no
  61.            effect. This is because some fields contain position sensitive
  62.            information; inserting or deleting characters could cause the
  63.  
  64.                                                       GETDEMO.DOC  Page 1
  65.  
  66.  
  67.            subfields in the string to be no longer valid.
  68.  
  69.         3. The prompt at the bottom of the screen gives the current field
  70.            number. This is simply to demonstrate that the program always
  71.            knows what the current field is. You could very easily adapt
  72.            the series of messages displayed to output context specific
  73.            information. For example, at the maximum overdraft field you
  74.            could output a message reminding the viewer what the current
  75.            maximum permitted value is.
  76.  
  77.         4. Help is provided outside the GET routines. In order not to
  78.            clutter up the program in a way that might distract from its
  79.            purpose, help information for the fields on the screen has not
  80.            been provided as part of the demonstration. Pressing F1 for
  81.            help simply produces a message, but it is clear that, since
  82.            the field number is known, context specific information could
  83.            be provided. One consequence of the way help is implemented is
  84.            that it is not possible to get help on a field while editing
  85.            it if it currently contains invalid data. (This could be
  86.            remedied by writing a GETHELP unit, which I may add a later
  87.            date).
  88.  
  89.         5. Numbers are edited differently from strings. A number can be
  90.            edited only at the right hand end, whereas a string can be
  91.            edited anywhere within the field.
  92.  
  93.  
  94.         Editing fields
  95.  
  96.         The editing facilities particular to each field type are
  97.         described in GET.DOC, e.g. the WordStar commands supported by
  98.         GETSTR. Certain commands are applicable in all fields.
  99.  
  100.  
  101.         ALT-X exits the field, without making changes, and terminates
  102.         data entry if the question "OK so far Y/N" is answered in the
  103.         affirmative.
  104.  
  105.         <Escape> exits the field, without making changes, and
  106.         unconditionally terminates data entry.
  107.  
  108.         Control Y deletes the field contents.
  109.  
  110.         Control U (for Undelete) restores the field contents to their
  111.         previous value.
  112.  
  113.         Control J will enter the default value for the field if one has
  114.         been specified (try it on the date and and time fields). Pressing
  115.         <ret> on a blank field will also enter a default value
  116.  
  117.         ALT-R will disable validation, if the user has privilege
  118.         (controlled by the boolean variable ValidationOverride) to do so.
  119.         This allows data outside given validation criteria to be entered.
  120.         [Note that instead of using a simple boolean to control privilege
  121.         one could use a numeric field and allow numerous levels of
  122.         privilege for controlling both the display and alteration of
  123.         data].
  124.  
  125.  
  126.  
  127.         GETDEMO.DOC  Page 2
  128.  
  129.  
  130.         Aggregate fields
  131.  
  132.         Date and time fields are comprised of aggregate strings. Each
  133.         subfield is a separate string. Thus Control Y (clear string) does
  134.         not clear the entire date or time field. However, ALT-Y does.
  135.         Similarly, Control U performs an undo on the contents of a string
  136.         and ALT-U does the same thing for an aggregate string.
  137.  
  138.  
  139.         Field Formatting
  140.  
  141.         Strings may be displayed via formatting strings, or "pictures",
  142.         to control on screen formatting and data validation. The zip
  143.         code, telephone number and social security fields are displayed
  144.         using pictures with embedded characters. The comment field is
  145.         displayed using a picture that split the comment string into 3
  146.         parts on separate lines.
  147.  
  148.         Completed numbers may be displayed as right or left justified,
  149.         with or without leading zeros. Zero value fields may be
  150.         suppressed (displayed as blank). Numbers being edited are always
  151.         edited from the right but may be left or right justified during
  152.         data entry (right justified numbers shift to the left during data
  153.         entry).
  154.  
  155.         Completed real numbers may be displayed using a variety of
  156.         formatting options. Cursor to the account balance field and
  157.         toggle the current value to a negative number (press the - key
  158.         and then press <ret>). Note that the colour of the field
  159.         background changed. This is called being in the red! (You'll need
  160.         a colour monitor to see this). Most of the options available to
  161.         spreadsheet users are available to control the display of real
  162.         number: negative numbers in parentheses, optional symbol before
  163.         or after the number, punctuation with commas, zero displayed as
  164.         blank etc.
  165.  
  166.  
  167.         Special fields
  168.  
  169.         GETDEMO includes a calculated field (Charges this month), a
  170.         display only field (Average balance this month) and a password
  171.         field (password).
  172.  
  173.         The calculated field is display only and does not have a field
  174.         number. It is not included in the list of fields displayed or
  175.         edited consecutively but is simply updated whenever the fields on
  176.         which it is dependent are displayed. It wouldn't take much to add
  177.         "intelligent recalculation," i.e., recalculate and redisplay this
  178.         field only when it should change. You may care to try this for
  179.         yourself.
  180.  
  181.         The display only field is included in the list of fields that may
  182.         be visited for editing. The status of a display only field may be
  183.         changed dynamically, so that it is or is not visited depending on
  184.         the content of one or more other fields or on the privilege of
  185.         the user. In this example it is simply locked out altogether.
  186.  
  187.         Because a password type field is not something likely to be
  188.         frequently used, a bit map is not used to indicate which fields
  189.  
  190.                                                       GETDEMO.DOC  Page 3
  191.  
  192.  
  193.         are of this type. Instead, a global variable PasswordField is set
  194.         to suppress echoing the contents of this field and is reset when
  195.         the field has been exited.
  196.  
  197.  
  198.         Available screen areas
  199.  
  200.         The last two lines of the screen are used for messages. This is
  201.         to keep this package simple. You can easily write your own error
  202.         handler that does more sophisticated things and frees the screen
  203.         currently space reserved for messages. The first line is used by
  204.         GETDEMO for displaying a message, it is not used by the GET
  205.         procedures and you are free to use it for whatever you wish (menu
  206.         options e.g.). Apart from an initial assumption of an 80 x 25
  207.         screen (having set the screen mode to either BW80 or CO80), the
  208.         GET procedures make no assumptions about the size of the screen.
  209.         CRTcols and CRTrows from Jim Le May's QWIK package are used in
  210.         all pertinent calculations. CRTcols and CRTrows will remain valid
  211.         if Qinit (from QWIK) is executed after any screen mode changes.
  212.  
  213.  
  214.         Other units
  215.  
  216.         The GET utilities are gathered, for convenience, into one
  217.         package. There is nothing to stop you making any GET procedures
  218.         into separate units if you should wish to do so.
  219.  
  220.  
  221.  
  222.  
  223.  
  224.  
  225.  
  226.  
  227.  
  228.  
  229.  
  230.  
  231.  
  232.  
  233.  
  234.  
  235.  
  236.  
  237.  
  238.  
  239.  
  240.  
  241.  
  242.  
  243.  
  244.  
  245.  
  246.  
  247.  
  248.  
  249.  
  250.  
  251.  
  252.         GETDEMO.DOC  Page 4