HomeStartingEnvironmentDBMSVisualPQLProceduresSQLFormsHost/APIIndex
Forms homecontents start chapter top of pagebottom of pagenext page index Using Forms

Using Forms

This covers how to use a form after it has been developed. It details how to enter data, how to locate records, how to move around the screens, and the commands that can be used.

Beginning a SirForms Session

You can run SirForms independently or from the SIR/XS menu.

See Running SirForms for details.

Passwords

Databases are protected from unauthorised access by passwords and security levels. A form may already have the passwords specified or may prompt for them. There are four possible pieces of information which may be required about the database. These are :

Database Password

Read Security
Write Security
Prefix


The form itself may have restricted access to particular operations. This is done through a Group Name and Group Password. If this form has restrictions by group, supply a group name and password to perform those particular operations.

All of these parameters can be specified on the execution statement or can be entered in response to prompts. If a particular prompt does not apply, simply skip it.

homecontents start chapter top of pagebottom of pagenext page index

Entering Commands

Every SirForms screen has two separate areas; one for data and another, at the bottom of the screen, for status messages and commands.

SirForms commands cyan be entered in one of three ways:

  1. Function keys. Some common commands are performed with Function keys. Function keys such as F1 are 'mapped' to specific commands; i.e. pressing the key performs the command. You can alter this mapping to suit your own style of working.

    The standard use of Shift-F1 is to display "key help". This is a list of keys mapped to functions. While this is displayed, you can update the mapping by using the menus on the screen. The mapping for SirForms defaults to SirForms.kmp. If this file does not exist, when you start SirForms for the very first time, you are prompted to set up some essential key maps. Whenever a specific key is mentioned in this documentation it assumes that no re-mapping has been done.

  2. Command Line. Commands can be entered at the command line but first you must position to the command line by either pressing the Ctrl-Enter (Command function key) or entering an = (equals sign) as the first and only character of a field. If the field is long enough then a command can be entered in the field by preceding it with an = (eg =WRITE).

  3. Special Characters. Certain characters may be entered as the first and only character in a data field and these then act as a command. Enter the single character command (which clears the field) and press Enter. The command is executed leaving the field unchanged with the original value restored.
See
Commands for a complete list of keys, commands and special characters.

Help

For help, either press F1 or go to the command line and type HELP. SirForms uses the same Help as the rest of SIR/XS and brings up the specified HTML browser.

Ending a SirForms Session

To terminate the session immediately, go to the command line and type EXIT. Alternatively use Shift-Esc(Stop) or Esc (Cancel) repeatedly to return through any previous screens to the root screen and then to end the forms session.

homecontents start chapter top of pagebottom of pagenext page index

Status Area

There are a number of status fields below the command line. There are two or three codes which indicate the mode this screen is in. Change the mode at the command line with the commands FIND or SEARCH, VERIFY or NOVERIFY and EDIT or NOEDIT. The default is FIND, NOVERIFY, EDIT, though these may be different in a particular form.

F | S

V
E | N
Screen: displays the name of the screen, and, if applicable, the page number and number of pages for the screen.

Cir/Rec: contains information about the case and record data being displayed. Init appears when the screen is in Find mode and is waiting for keys to be specified. Search Init appears when the screen is in Search mode and is waiting for a search specification. When a record or row has been retrieved, the two fields in parentheses show the type of lock and record status. These are primarily of interest when multiple people may be accessing records in concurrent mode. If you are using SirForms in concurrent mode, see Master.

Status: is where messages are displayed.

homecontents start chapter top of pagebottom of pagenext page index

Entering Data

Each data field on the screen has a prompt or description of the information and a data area to enter or to display the data. When a screen is initially displayed, fields may already have data in them or the fields may be waiting for data to be entered. Each data area that is waiting for data is filled with a character that indicate the number of characters in the field (periods ..... by default).

To enter data into a field, type in the data. When you have finished, press Enter. To skip over fields, use the Up Arrow and Down Arrow keys. Up Arrow goes back a field, Down Arrow goes forward a field. Pressing Enter without typing in any data, also skips forward over a field.

Field Editing Operations

When you are positioned to a data entry field, you may edit the contents of the field. Left Arrow and Right Arrow position the cursor within the field and Enter terminates data entry and moves to the next field. For the specific keys to use for the other field editing functions listed below, use Shift-F1 (key help). The following field editing functions are supported:

Insert/Overstrike

Delete Character
Un-delete Character
Delete Field
Un-delete Field
Store Blank
Store Undefined

Long Character Fields

Character (string) fields, may be longer than the display space on the screen. These fields scroll left and right as you type or as you use the left and right arrows.

No Data

If you move past a field with Down Arrow , or do not type anything and just press Enter, the data remains unaltered. If nothing is entered on a new record, the field is set to Undefined (the System Missing Value). If you enter blanks or edit a field and end up with blanks, this is different from Undefined and may be a valid missing value.
(DelField) makes a field Undefined; (BlankField) stores blanks in a field

Field Help

For information about a field or about a field error message, use the Alt-F1 (Default Field Help) key. SirForms displays information about the field from the data dictionary. This includes the name of the field, its input format, its data type, the range of acceptable values, what its legal missing values are and what the codes mean. After reading the help information, return to the Record screen by pressing Enter. There is also the Ctrl-F1 Custom Field Help key.
The information may appear in the status line at the bottom of the screen or it may appear on a separate screen. If there is no custom help screen or status line message, the same default help is displayed.

homecontents start chapter top of pagebottom of pagenext page index

Flow of Control

The normal flow of control is from one field to the next field. This may happen automatically when a field has been completely entered (known as Autotab) or you may have to press Enter to move to the next field.

Up Arrow moves to the previous field, Down Arrow and Enter move to the next field. Fields may be organised in Groups. The Next Group key goes to the first field in the next group; the Previous Group key goes to the first field in the previous group; the Top of Group key goes to the first field in this group.

The Top of Page key goes to the first data field on this screen. The Ctrl-R Restart key clears the whole screen to enter new key field values.

Moving from Screen to Screen

A form usually consists of multiple screens. The data for one record may not fit on a single screen and may be split into Pages. If a screen is on multiple pages, the Page Down - Next page key moves to the next page; the Page Up - Previous page key moves to the previous page. When you move past the last field on a page, the next page is usually displayed automatically (this can be set by the screen designer). Similarly, if you move back past the first field on the second or subsequent page, the previous page is displayed. Screens for different records are linked together through menus or under program control.

A Menu is like a table of contents that tells you what other screens you can select. Page Down or a response of "Y" at the appropriate prompt, goes to that screen. This is known as "calling" a screen. Page Up or Esc returns to the calling screen. Another screen may be called from the lower level screen and screens may be nested as deeply as necessary.

Certain screens may be defined as Stop screens. The Shift-Esc Stop key returns to a higher level stop screen. This avoids going back through each level of called screen in a hierarchy of screens. (The very first screen is always a stop screen.)

homecontents start chapter top of pagebottom of pagenext page index

Accessing Records and Rows

Key fields identify the record or row and are usually grouped at the top of the screen. The key fields are the first fields entered. When you enter a key for an existing record, the data for that is displayed. If you enter a key which does not exist, a new record is created.

Creating New Records

To create a new record or row, enter all the key fields. After the last key, a message that a new record has been created is displayed and the cursor moves to the first data field.

Enter the data fields. If the data for a field is invalid, an error message is displayed on the status line and the cursor returns to the beginning of that field for another entry.

The Write key or command writes the data to the database and clears all the fields. To write the data and leave the data on the screen, use Up Arrow to move to the key portion of the screen. This allows you to enter a new key value and use the existing fields as a starting place for the new record.

If you issue a command to move away from a screen where data has been modified, SirForms may ask whether to write this record. (When a form is created, it can specify that data is automatically written when you leave the screen.) Reply "OK" or "Y" to write the data.

Locating or Updating a Specific Record

To locate a specific record, enter data in all the key fields. The matching record is then retrieved. If no record in the database matches the key, a message that a new record has been accessed is displayed. The Restart key or command redisplays the screen without creating a new record.

If you omit a key field, the first record that matches whatever keys are entered is retrieved. If all key fields are blank, the first record in the database is retrieved.

There are function keys and commands to browse through sets of records. First retrieves the first record; Last retrieves the last record; Next and Previous go through the set of records one at a time in the specified direction. If no more records are available in the set, a message is displayed that the end of file has been reached.

Updating a Record

Once a record is displayed, you can modify the data fields. The CANCEL command restores the original data "undoing" whatever changes were made. When you have finished updating the record, RESTART, WRITE, or moving away from the screen, writes the changed data.

Deleting Records

Once a record is displayed, the DELETE command marks it for deletion. The record is deleted when you RESTART or WRITE the screen or you move away from the screen. To nullify the deletion, use UNDELETE before taking one of these actions.

If the screen has been specified to write records automatically, it is possible to create new records erroneously. If a record key (all the key fields) is entered which is not on the database, a new record is created. When you move away from the screen or restart, that record is written automatically. Use the DELETE command to flag the record for deletion in this instance.

Marking A Key Level

When going through records using NEXT and PREVIOUS, SirForms is controlling the set of records to access. If the top level key or partial key is entered, FORMS automatically restricts the set to records defined by that key. MARK allows you to go outside of this range. This is particularly useful when you do not know an exact key, but know roughly the value to start at. Mark a key field and enter a key value; this positions to that record or the first record with a higher key if that key does not exist. If key fields have not been Marked, a new record is created for keys which do not exist.

To mark a key field, position the cursor to the keyfield and use the (Mark) key. Forms responds with the message A "key level tagged". Then enter the start key value. To enter a different start key, mark the key again.

For Example: Use the Employee record and suppose 46 exists, but 45 does not. First mark the Identification Number and enter 45. Note that Employee 46 is displayed and that you can use (Next) and (Prev) to browse forwards or backwards from that point.

Now do not mark Identification Number and enter 45. Note that a new employee, 45, is created and if you use (Next) or (Prev) an error message 152 A "Command is not legal at current time" is issued.

homecontents start chapter top of pagebottom of pagenext page index

Search Mode

Search mode locates records based on search specifications. These can consist both of key and non-key data. You cannot create new records in Search mode.

To set the search specifications, set Search Mode with the SEARCH command at the command line. This displays a screen with all fields blank. Then enter values in the fields to be searched. When you have finished entering the search specification, use FIRST, NEXT, PREVIOUS or LAST to retrieve matching records. While searching for a record to match the search specification, you may see a ".....searching" message displayed on the Status line.

If there are no more records that match the search pattern, a message is displayed. Terminate the search with RESTART.

The search specifications in individual fields are used to search for records with values which match all of the specified values.

The WHERE command defines search specifications that include logical conditions such as an OR condition, a NOT condition or tests for greater than or less than. For example, to search for employees who earn more than $3000;

WHERE (SALARY GT 3000) The WHERE command can be used in addition to individual field specifications. Only one WHERE clause is active at one time. Enclose the conditions on the WHERE in parentheses.

The hash sign (#) represents the field where the cursor was positioned when you went to the command line. For example, to search for female employees, position the cursor at the field GENDER and then go to the command line and enter

WHERE (# = 2)

Search Patterns

Values specified in fields are matched to be equal. To match on part of a field, use the percent sign (%) as a "wildcard" or A "match anything" symbol. For example, to retrieve the records for anyone with a last name ending in FORD, enter %FORD in the name field. String searches are case sensitive.

The wildcard symbol can appear more than once in the field. For example, %ABC%, finds names that contain ABC anywhere in the name.

Patterns can be used in a WHERE ... LIKE command. For example, to search for all the people whose names start with Fred:

WHERE (NAME LIKE '%Fred?')
Enclose the pattern including any symbols in single quotes. A pattern can consist of any character plus the following symbols:

? any character
% beginning of line
$ end of line
[...] list of characters (i.e.,any of these characters)
[!...] negated list of characters (i.e., all but these characters)
* zero or more occurrences of the previous character or list
+ one or more occurrences of the previous character or list
To specify a list of characters, specify either single characters or ranges of characters separated by a dash. The list must be enclosed in square brackets { [ ] }. Any character in the brackets is treated as the literal character not as the symbol.

Note that the pattern matching symbols used in where are not the same as the wildcards used in field.

The pattern matching features of the WHERE ... LIKE clause are extensive and are identical to those of SQL pattern matching.

homecontents start chapter top of pagebottom of pagenext page index

Verify Mode

Verify mode is used to validate existing data. Verify mode is set with the VERIFY command at the command line. When in Verify mode, use the normal Find or Search mode techniques to retrieve records. When a record or row is located, the response area of each field is filled with the letter "V". To verify the row or record, enter values into the data fields. These are checked to see if the data that you have entered matches the data that was previously entered in that field. If it does, the cursor moves to the next data field. If the value does not match the data in the field, an error message is issued, and the previously entered data is displayed in the field. If the original entry is incorrect, modify it, press Enter, and continue processing.

To stop using Verify mode, use the NOVERIFY command at the command line.

homecontents start chapter top of pagebottom of pagenext page index

Printing Screens

You can copy a screen to a file for later printing. The copy can contain the complete screen, just the data or just the screen without the data. The output file must be specified when you launch SIR FORMS; use the "Print=filename" parameter on the execution statement. To print a screen, use the PRINT command or key. PRINT LABELS leaves off the data; PRINT DATA leaves off the labels.

This is a text representation of the screen not a graphic. If you wish to save a "picture" of a screen, use your normal screen save process. (eg Alt PrtSc in Windows).

homecontents start chapter top of pagebottom of pagenext page index

Keys and Commands

The following is a list of SirForms actions with function keys, symbols (one special character typed in a field) and commands. Some actions can only be performed by entering the command (e.g. SEARCH), and some can only be done with keys (e.g. delete a character).

To use the command symbols, enter the single character command (which clears the field) and press Enter. The command is executed leaving the field unchanged with the original value restored.
KeySym.CommandAction
Shift-F1   Get help on keys
Esc < RETURN Go back a screen
Shift-Esc . STOP Go back to stop screen
Left Arrow   Moves left in a field for editing. Returns to a previous screen at a CALL prompt
Right Arrow    Moves right in a field for editing. Moves to chosen screen at a CALL prompt
Down Arrow   Moves past a field
Up Arrow    Moves back a field
Del    Deletes the character at the cursor position.
Bksp    Deletes the character before the cursor position
shift-Del    Delete the field
ctrl-Z    Restore the previously deleted field
ctrl-U    Make a field Undefined
ctrl-B    Make a field blank
ctrl-F1?   Get help on a field
Alt-F1!   Get dictionary help on a field
Pg Dn>   Call Screen or Page Down
Shift-Enter=   Go to Command Line
Ctrl-M@   Mark a key level
Ctrl-Left Arrow( FIRST Retrieve first record or row
Ctrl-Right Arrow) LAST Retrieve last record or row
Shift-Right Arrow] NEXT [n] Retrieve next record or row. [Skip forward n.]
Shift-Left Arrow[ PREVIOUS [n] Retrieve previous record or row. [Skip back n.]
Ctrl-R* RESTART Clears the current screen to specify new keys to retrieve.
 ^ TOP Moves cursor to first field on page
   CANCEL Restores original data.
   DELETE Marks record or row for deletion.
   DFIRST Deletes current and retrieves first.
   DLAST Deletes current and retrieves last.
   DNEXT n Deletes current and retrieves next.
   DPREVIOUS n Deletes current and retrieves previous.
   DRESTART Deletes current and restarts screen.
   DRETURN Deletes current and returns to calling screen.
   EXIT Finishes SirForms session.
   FIND Sets Find on.
   NOVERIFY Turns Verify off.
   PAGE n Moves to a page.
   PRINT Prints screen. DATA prints data only. LABEL prints labels only.
   SEARCH Sets search mode.
   STATUS Displays status.
   UNDELETE Removes delete flag from current record or row if it is marked for deletion.
   UPDATE Writes record and positions to first field on record
   WHERE Sets a search condition.
  # WRITE Writes record and clears screen.

homecontents start chapter top of pagebottom of pagenext page index