home *** CD-ROM | disk | FTP | other *** search
-
-
-
- GETDEMO
-
- This program is intended to demonstrate the use of some GET
- procedures and will, I hope, illustrate how easy it is to use
- them in concert to get a screenful of information.
-
-
- What's it all about?
-
- The GET procedures take the grunt work out getting information
- from the screen. You simply say what you want, where you want to
- get it from, and leave the rest to the GET procedure of your
- choice. Several GET procedures can be used together to make a
- form; with only a little extra work your form can include display
- only, calculated and password fields.
-
-
- Moving about the screen
-
- Navigation about the form is very straightforward. The up and
- down arrow keys may be used to take you to the previous and next
- fields respectively. Control Home takes you to the first field,
- and Control End takes you to the last field. The <return> and
- <tab> keys function like the down arrow and shift <tab> works
- like the up arrow key. Practise moving about the form using these
- keys.
-
- Now try the left and right arrow keys. These can also take you
- about the form, however they are used for moving within string
- fields as well for moving about the field. The horizontal arrow
- keys don't have to take you to the same fields as the vertical
- arrow keys but they do in this demonstration. Note the function
- of the Home and End keys when the cursor is in a string field.
-
- As you move from field to field you'll notice certain things.
-
- 1. The colour of the current field is different from that of
- other fields. This is simply to draw attention to the field,
- so it is easy to find on the screen. The variable FieldCursor
- controls the value of the colour displayed for the current
- field. If FieldCursor has the value 0 then the colour of the
- field remains unchanged.
-
- 2. In string fields the blinking cursor disappears and is
- replaced by a solid block of colour. This "video (attribute)
- cursor" (as opposed to a real one) is used to make a non-
- blinking cursor, which I happen to prefer. It is accomplished
- by changing the attribute byte of the appropriate screen
- location. You don't have to use this sort of cursor of course,
- but the option is there. Pressing the Insert key will toggle
- the display of the normal underline cursor on or off,
- depending on its previous state. A blinking underline cursor
- means that overwrite mode is on. A block cursor, blinking or
- non-blinking, means that insert mode is on.
-
- In some string fields you'll notice that the underline cursor
- is forced on all the time, pressing the Insert key has no
- effect. This is because some fields contain position sensitive
- information; inserting or deleting characters could cause the
-
- GETDEMO.DOC Page 1
-
-
- subfields in the string to be no longer valid.
-
- 3. The prompt at the bottom of the screen gives the current field
- number. This is simply to demonstrate that the program always
- knows what the current field is. You could very easily adapt
- the series of messages displayed to output context specific
- information. For example, at the maximum overdraft field you
- could output a message reminding the viewer what the current
- maximum permitted value is.
-
- 4. Help is provided outside the GET routines. In order not to
- clutter up the program in a way that might distract from its
- purpose, help information for the fields on the screen has not
- been provided as part of the demonstration. Pressing F1 for
- help simply produces a message, but it is clear that, since
- the field number is known, context specific information could
- be provided. One consequence of the way help is implemented is
- that it is not possible to get help on a field while editing
- it if it currently contains invalid data. (This could be
- remedied by writing a GETHELP unit, which I may add a later
- date).
-
- 5. Numbers are edited differently from strings. A number can be
- edited only at the right hand end, whereas a string can be
- edited anywhere within the field.
-
-
- Editing fields
-
- The editing facilities particular to each field type are
- described in GET.DOC, e.g. the WordStar commands supported by
- GETSTR. Certain commands are applicable in all fields.
-
-
- ALT-X exits the field, without making changes, and terminates
- data entry if the question "OK so far Y/N" is answered in the
- affirmative.
-
- <Escape> exits the field, without making changes, and
- unconditionally terminates data entry.
-
- Control Y deletes the field contents.
-
- Control U (for Undelete) restores the field contents to their
- previous value.
-
- Control J will enter the default value for the field if one has
- been specified (try it on the date and and time fields). Pressing
- <ret> on a blank field will also enter a default value
-
- ALT-R will disable validation, if the user has privilege
- (controlled by the boolean variable ValidationOverride) to do so.
- This allows data outside given validation criteria to be entered.
- [Note that instead of using a simple boolean to control privilege
- one could use a numeric field and allow numerous levels of
- privilege for controlling both the display and alteration of
- data].
-
-
-
- GETDEMO.DOC Page 2
-
-
- Aggregate fields
-
- Date and time fields are comprised of aggregate strings. Each
- subfield is a separate string. Thus Control Y (clear string) does
- not clear the entire date or time field. However, ALT-Y does.
- Similarly, Control U performs an undo on the contents of a string
- and ALT-U does the same thing for an aggregate string.
-
-
- Field Formatting
-
- Strings may be displayed via formatting strings, or "pictures",
- to control on screen formatting and data validation. The zip
- code, telephone number and social security fields are displayed
- using pictures with embedded characters. The comment field is
- displayed using a picture that split the comment string into 3
- parts on separate lines.
-
- Completed numbers may be displayed as right or left justified,
- with or without leading zeros. Zero value fields may be
- suppressed (displayed as blank). Numbers being edited are always
- edited from the right but may be left or right justified during
- data entry (right justified numbers shift to the left during data
- entry).
-
- Completed real numbers may be displayed using a variety of
- formatting options. Cursor to the account balance field and
- toggle the current value to a negative number (press the - key
- and then press <ret>). Note that the colour of the field
- background changed. This is called being in the red! (You'll need
- a colour monitor to see this). Most of the options available to
- spreadsheet users are available to control the display of real
- number: negative numbers in parentheses, optional symbol before
- or after the number, punctuation with commas, zero displayed as
- blank etc.
-
-
- Special fields
-
- GETDEMO includes a calculated field (Charges this month), a
- display only field (Average balance this month) and a password
- field (password).
-
- The calculated field is display only and does not have a field
- number. It is not included in the list of fields displayed or
- edited consecutively but is simply updated whenever the fields on
- which it is dependent are displayed. It wouldn't take much to add
- "intelligent recalculation," i.e., recalculate and redisplay this
- field only when it should change. You may care to try this for
- yourself.
-
- The display only field is included in the list of fields that may
- be visited for editing. The status of a display only field may be
- changed dynamically, so that it is or is not visited depending on
- the content of one or more other fields or on the privilege of
- the user. In this example it is simply locked out altogether.
-
- Because a password type field is not something likely to be
- frequently used, a bit map is not used to indicate which fields
-
- GETDEMO.DOC Page 3
-
-
- are of this type. Instead, a global variable PasswordField is set
- to suppress echoing the contents of this field and is reset when
- the field has been exited.
-
-
- Available screen areas
-
- The last two lines of the screen are used for messages. This is
- to keep this package simple. You can easily write your own error
- handler that does more sophisticated things and frees the screen
- currently space reserved for messages. The first line is used by
- GETDEMO for displaying a message, it is not used by the GET
- procedures and you are free to use it for whatever you wish (menu
- options e.g.). Apart from an initial assumption of an 80 x 25
- screen (having set the screen mode to either BW80 or CO80), the
- GET procedures make no assumptions about the size of the screen.
- CRTcols and CRTrows from Jim Le May's QWIK package are used in
- all pertinent calculations. CRTcols and CRTrows will remain valid
- if Qinit (from QWIK) is executed after any screen mode changes.
-
-
- Other units
-
- The GET utilities are gathered, for convenience, into one
- package. There is nothing to stop you making any GET procedures
- into separate units if you should wish to do so.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- GETDEMO.DOC Page 4