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