Describing the CRT Screen

In this section:

 

The MODIFY statement CRTFORM or the Dialogue Manager control statement -CRTFORM, followed by the screen layout, generates a form. Within one MODIFY procedure, you can use an unlimited number of screen lines (within memory constraints). Each screen line can contain a maximum of 78 characters of text and data.

In MODIFY, you can use up to 255 CRTFORM statements in a procedure. In Dialogue Manager, there is no limit to the number of -CRTFORM statements that you may use in one procedure.

All the basic options described here can be used with both MODIFY and Dialogue Manager. Options that are specific to MODIFY are discussed in Using FIDEL in MODIFY and those specific to Dialogue Manager are discussed in Using FIDEL in Dialogue Manager.

The following example shows the syntax of a simple MODIFY CRTFORM using the LOWER case option, followed by two screen lines containing various screen elements: text, a spot marker, and a field (numbers refer to the explanation; they are not part of the code):

1. CRTFORM LOWER 
2. "PLEASE FILL IN THE EMPLOYEE ID # </1" 
3. "EMPLOYEE ID #: <EMP_ID"
   MATCH EMP_ID
    .
    .
    .

Processing is as follows:

  1. CRTFORM invokes FIDEL and generates the form. The LOWER case option specifies that what is entered from the terminal in lowercase will remain in lowercase.
  2. The first line of the screen contains descriptive text.

    </1 is a spot marker which skips one blank line.

  3. The last line of the screen contains two screen elements: descriptive text that identifies the field and the data source field EMP_ID. The last line between quotation marks signals the end of the CRTFORM.

The form generated appears as follows:

PLEASE FILL IN THE EMPLOYEE ID #
EMPLOYEE ID #:

Top of page

x
Specifying Elements of the CRTFORM

How to:

To create the visual form, you enter the screen lines one after the other within double quotation marks. For each screen line, you can specify various screen elements such as descriptive text and fields. A left caret (<) followed by the name of the field generates the position where data is to be entered onto the screen.

You may need to use two FOCEXEC lines to describe one physical CRTFORM line. Simply omit the double quotation marks (") at the end of the first line and omit them at the beginning of the next line as well. Everything between the set of double quotation marks will read as one screen line on the CRTFORM.



x
Syntax: How to Invoking FIDEL: CRTFORM and -CRTFORM

The following is a summary of the complete syntax for generating a CRTFORM in MODIFY or a -CRTFORM in Dialogue Manager. The individual options and screen elements are described in detail in specific sections later in the chapter. The syntax is

[-]CRTFORM [option option...]
[-]"screen element [screen element....]"

where:

[-]CRTFORM

Automatically invokes FIDEL and sets up the visual form. Subsequent lines describe the screen.

option option...

Refers to screen control options. (See Using FIDEL in MODIFY and Using FIDEL in Dialogue Manager.)

[-]"screen element.."

Can be user-defined text, fields, or spot markers. Spot markers define the next place on the screen where a screen element will appear. Both spot markers and fields are preceded by a left caret and optionally closed by a right caret (see Specifying Elements of the CRTFORM).

Note:


Top of page

x
Defining a Field

How to:

Reference:

Labels, prefixes, attributes, and formats are parts of the definition of a particular field. In Dialogue Manager, the first character is an ampersand, which signals an amper variable. (The entire definition is preceded by a left caret and optionally closed by a right caret.)

Note: Fields with a text (TX) format cannot be used in CRTFORM or -CRTFORM. However, they can be entered interactively using TED (see Entering Text Data Using TED, for using text fields in MODIFY).



x
Syntax: How to Define a Field in FIDEL

The syntax for defining a field is as follows.

In MODIFY:

<[:label.][prefix.][attribute.]field[/length][>]

In Dialogue Manager:

<[&:label.][prefix.][attribute.]&variable[/length][>]

where:

:label.|&:label.

Is a user-defined label of up to 12 characters associated with a field. It may not contain embedded blanks (see Using Labeled Fields).

prefix.

Refers to D. or T., which designate a display or turnaround field, respectively (see Data Entry, Display and Turnaround Fields).

attribute.

Is the abbreviation or full name of a screen attribute (see Specifying Screen Attributes).

field

Is the name of the field or variable being defined.

&variable

Is for data entry. Can be a data source field or a temporary field.

/length

Is the length of the field as it appears on the screen. In MODIFY, you need to define a length only if you want the screen length to be different from the format length that is defined in the MASTER or COMPUTE. In Dialogue Manager, you need to define a length only if not previously defined.

Note: When you use the abbreviations for attributes, you do not need to use the dot separator between attributes or between a prefix and an attribute (see Specifying Screen Attributes).



Example: Defining a Field

The following is an example of the syntax of a Dialogue Manager screen line defining the variable field &CITY:

-CRTFORM
-"<&:L01.T.HIGH.&CITY/7"
       .
       .
       .

The elements on the second line which define the variable field &CITY are:

  1. The left caret generates a place for the variable on the screen.
  2. &:L01 is a label that identifies the data entry area on the screen (see Using Labeled Fields).
  3. T. is a prefix that defines the variable as a turnaround field. If the variable has been given a value within the FOCEXEC, it is displayed. Otherwise a default value is displayed. The operator can then change the value.
  4. .HIGH. is a screen attribute specifying that the contents of the field will be highlighted.
  5. &CITY/7 is the name of the variable field with a length specification. The specified length is seven characters. That is, the space that will be allotted on the screen for input of data is seven characters long.

Prefixes, labels, and screen attributes are explained fully in Data Entry, Display and Turnaround Fields, Specifying Screen Attributes, and Using Labeled Fields.



x
Reference: Difference in FIDEL When Used With MODIFY and Dialogue Manager

The following chart outlines the similarities and differences of FIDEL when used with MODIFY and Dialogue Manager:

MODIFY

Dialogue Manager

CRTFORM [options]
-CRTFORM [options]
UPPER/LOWER
CLEAR/NOCLEAR
WIDTH/HEIGHT
TYPE
LINE
UPPER/LOWER
BEGIN/END
TYPE
"screen elements" 
text 
  
<spot marker[>]**
<field/length[>]* 
prefix.(D. or T.)*** 
attribute.
:label.
"screen elements" 
text 
 
<spot marker[>]**
<field/length[>]** 
prefix.(D. or T.)*** 
attribute 
&:label.

* The right caret denotes a non-conditional field.

** The right caret has no meaning, but may be used for increased clarity.

*** Prefixes, attributes and labels are part of the definition of the field on the screen. They do not stand alone.



x
Using Spot Markers for Text and Field Positioning

Because the lengths of fields vary, text does not automatically align uniformly on the screen. Spot markers are available to help you position both text and fields. Please note that a spot marker is essential to eliminate trailing blanks at the end of the first line, if your screen line description takes up two FOCEXEC lines.

The syntax and usage of the different spot markers are shown in the following chart:

Marker

Example

Usage

<n or <n>
<50

Positions the next character in column 50.

<+n or 
<+n>
<+4

Positions the next character four columns from the last non-blank character.

<-n or 
<-n>
<-1

Positions the next character one column to the left of the last character. This marker's function is to suppress or write over the attribute byte at the beginning and the end of a field.

</n or </ 
n>
</2

Positions the next character at the beginning of the line that is two lines from the last (skips two lines). Note: The last line is blank and is created when a double quotation mark (") is encountered.

<0X or 
<0X>
<0X

Positions the next character immediately to the right of the last character (skip zero columns). This is used to help position data on a FIDEL screen when a single screen line is coded as two lines in a FOCEXEC. No spaces are inserted between the spot marker and the start of a continuation line (see Note 3 in the following example).

Note: You can optionally use the right caret >. This is useful when the next character in the line is a left caret. It also enhances readability.

Suppose you want the various input data fields arranged across the screen in vertical sections, left justified, and in horizontal segments marked off with lines. Using spot markers, you can create the desired screen as shown in the following example:

   MODIFY FILE EMPLOYEE
   CRTFORM
    "EMPLOYEE UPDATE" 
1.  "</1"
    "-----------------------------------------------------------"
    "EMPLOYEE ID #: <EMP_ID   LAST NAME: <LAST_NAME" 
1.  "</1" 
2.  "DEPARTMENT: <DEPARTMENT <+3 CURRENT SALARY:<0X>
    <CURR_SAL"
    "-----------------------------------------------------------"
    "BANK: <BANK_NAME"
    "-----------------------------------------------------------"
   MATCH EMP_ID
   .
   .
   .
   DATA
   END

The spot markers in the example perform the following functions:

  1. </1 generates a blank line.
  2. <+3 moves the word CURRENT three spaces to the right of the last letter in the word DEPARTMENT. <0X> skips no spaces. No extra spaces are inserted between this and the next word (<CURR_SAL) on the continuation line. There is, in fact, one space before the field which is an attribute byte that marks the start of a field.

The screen appears as:

EMPLOYEE UPDATE
 
 
----------------------------------------
EMPLOYEE ID #:  LAST NAME:
 
 
DEPARTMENT:  CURRENT SALARY:
----------------------------------------
BANK:
----------------------------------------


x
Specifying Lowercase Entry: UPPER/LOWER

All text that is entered from the terminal is normally translated to uppercase letters. You can override this default and preserve both uppercase and lowercase text by using the lowercase option. The syntax is

[-]CRTFORM [UPPER|LOWER]

where:

UPPER

Translates all characters to uppercase. This is the default.

LOWER

Reads lowercase data from the screen. Once you specify LOWER, every screen thereafter is a lowercase screen until you specify UPPER.

Note: In MODIFY, when you use multiple CRTFORMs on the same screen (using LINE n), you can mix UPPER and LOWER among the forms.


Top of page

x
Data Entry, Display and Turnaround Fields

How to:

There are three types of data or variable fields that can be specified on the CRTFORM: data entry, display, and turnaround.

You can also compute data fields (see Computing Values: The COMPUTE Statement, for rules about computing data fields) and specify them as entry, display, or turnaround on the CRTFORM. You can convert a turnaround field to a display field dynamically.

In MODIFY, fields can also be designated as conditional or unconditional (see Conditional and Non-Conditional Fields). We recommend that for data entry, you use conditional fields (left caret only) so that the values in your data source are not replaced by a blank or a zero if you do not enter data for the field.

For most turnaround fields, we recommend that you use non-conditional fields (both carets). A non-conditional turnaround field remains active whether you enter data or not. Because the value in the data source is displayed in the field, that value remains in the data source if you do not change it. Because the field remains active, the values for your VALIDATEs and COMPUTEs are then accurate (see Conditional and Non-Conditional Fields for a complete explanation of the use of conditional and non-conditional fields in MODIFY).

The following outlines the rules for specification of different types of fields.



x
Syntax: How to Use Data Entry Fields (for Data Entry Only)

In MODIFY, the syntax is

<field[/length][>]

where:

<field[>]

Is the name of the field. Reserves space on the screen for data entry into that field and does not display the current value of the field.

In MODIFY, if only the left caret is used, data entry is conditional. If both carets are used, the field is non-conditional (see Conditional and Non-Conditional Fields).

In Dialogue Manager the syntax is

<&variable[/length][>]

where:

<&variable[>]

Is the name of the variable field. Reserves space on the screen for data entry into that field and does not display the current value of the field.

In Dialogue Manager, the option of the right caret is meaningless. Usually for the FOCEXEC to run, you must supply a value for each variable. If you do not, FOCUS assumes a blank or a 0 for that value.



x
Syntax: How to Use Display Fields (for Information Only)

Data is displayed in a protected area and cannot be altered.

In MODIFY, the syntax is

<D.field[/length]

In Dialogue Manager, the syntax is

<D.&variable[/length]

where:

D.

Is the prefix placed in front of a field, indicating that the data or value is to be displayed. The current value of the field appears on the screen, but in a protected area which cannot be changed.

Note that the right caret is meaningless for display fields.



x
Syntax: How to Use Turnaround Fields (for Display and Change)

Data is displayed in an unprotected area and can be altered.

In MODIFY, the syntax is:

<T.field[/length][>]

In Dialogue Manager, the syntax is:

<T.&variable[/length][>]

where:

T.

Is the prefix placed in front of a field to indicate that it is a turnaround field. The current value of the field is displayed on the screen. However, the operator may change the value, as it is not in a protected area.

In MODIFY, if only the left caret is present, the T. field is treated as conditional. If the right caret is used, the field is non-conditional, and the value is treated as present, even if unchanged (see Conditional and Non-Conditional Fields).

In Dialogue Manager, the changed value for the turnaround variable field will substitute everywhere in the FOCEXEC where it is subsequently encountered.

Note: In MODIFY, in order to display data from a data source field or present it for turnaround, a position in the data source must first be established through the use of a MATCH or NEXT statement, or value must be assigned in a COMPUTE. A computed field cannot be set and displayed in the TOP case, where data entry is processed prior to computations. For example, one of the phrases

ON MATCH CRTFORM
ON NEXT CRTFORM

must be used. A position is thus established in the data source, and the values of the fields in existing records are now available for display as protected or unprotected fields.

You can also match on a key field and go to a case (see CRTFORMs and Case Logic) in which you display a CRTFORM using display and turnaround fields.


Top of page

x
Using Data Entry, Display, and Turnaround Fields

This section will show how to use Date Entry, Display, and Turnaround Fields with MODIFY and Dialogue Manager.



Example: Using Data Entry, Display, and Turnaround Fields With MODIFY

The following example combines two CRTFORMs in a single MODIFY request and shows the use of entry, display and turnaround fields (numbers refer to the explanation below; they are not part of the code):

    MODIFY FILE EMPLOYEE 
1.  CRTFORM
       "ENTER EMPLOYEE ID#: <EMP_ID"
       "PRESS ENTER"
       "</2" 
2.  MATCH EMP_ID
       ON NOMATCH REJECT
       ON MATCH CRTFORM
          " "
          "REVISE DATA FOR SALARY AND DEPARTMENT"
          "ENTER NEW DATA FOR EDUCATION HOURS"
          " " 
3.        "EMPLOYEE ID #: <D.EMP_ID   LAST_NAME: <D.LAST_NAME"
          " " 
4.        "SALARY:    <T.CURR_SAL>"
          "DEPARTMENT: <T.DEPARTMENT>" 
5.        "EDUCATION HOURS: <ED_HRS>"
       ON MATCH UPDATE CURR_SAL DEPARTMENT ED_HRS
    DATA
    END

The procedure matches the employee ID, displays both the ID and the last name, and then displays the current salary and department for turnaround. Education hours is a data entry field.

Note that when the procedure executes, both CRTFORMs are displayed immediately. However, the display and turnaround fields in the second CRTFORM do not display data until the operator fills in the first form and presses Enter. We therefore recommend you use the LINE option.

When a FORMAT ERROR occurs, all data entered up to that point is processed and cannot be changed in the course of your transaction.

The processing is as follows:

  1. CRTFORM generates the first form which begins on line 1 (the second CRTFORM is displayed, but without values):

    ENTER EMPLOYEE ID #:
    PRESS ENTER
     
    REVISE DATA FOR SALARY AND DEPARTMENT
    ENTER NEW DATA FOR EDUCATION HOURS
     
    EMPLOYEE ID #:   LAST NAME:
    SALARY:
    DEPARTMENT:
    EDUCATION HOURS:

  2. The procedure continues with the MATCH logic. If the ID number that is input matches an ID in the data source, the display and turnaround fields on the second CRTFORM display the data. Assume the operator enters 818692173 and presses Enter.

    The following is displayed:

    ENTER EMPLOYEE ID #: 818692173
    PRESS ENTER
     
    REVISE DATA FOR SALARY AND DEPARTMENT
    ENTER NEW DATA FOR EDUCATION HOURS
     
    EMPLOYEE ID #: 818692173     LAST NAME: CROSS
    SALARY:   27062.00
    DEPARTMENT:  MIS
    EDUCATION HOURS:

  3. This screen line contains two display fields.
  4. The next two screen lines contain turnaround fields.
  5. The last line is a data entry field.

Note: To display fields from a unique segment, the ON MATCH CONTINUE TO, ON NEXT, or MATCH WITH-UNIQUES phrase must have been executed (see Modifying Data: MATCH and NEXT).

In Dialogue Manager, in order to display values with D. or T., a value must have been supplied for the variable prior to the initiation of the -CRTFORM. System variables are an exception to this rule, as the system automatically supplies their values.

Computed fields in both MODIFY and Dialogue Manager can be displayed in any kind of CRTFORM.



Example: Using Data Entry, Display, and Turnaround Fields With Dialogue Manager

The following example illustrates the use of D. fields and system variables in a Dialogue Manager -CRTFORM:

 
1.  -SET &CITY = STAMFORD;
  
2.  -CRTFORM 
3.  -"YEARLY SALES REPORT FOR <T.&CITY/10" 
4.  -"DATE: <D.&DATE  TIME: <D.&DATEMDYY"
    -" "
    -"ENTER BEGINNING PRODUCT CODE RANGE: <&BEGCODE/3"
    -"ENTER ENDING PRODUCT CODE RANGE: <&ENDCODE/3"
    -"ENTER NAME OF REGIONAL SUPERVISOR: <&REGIONMGR/15"
    TABLE FILE SALES
    HEADING CENTER
    "YEARLY REPORT FOR &CITY"
    "PRODUCT CODES FROM &BEGCODE TO &ENDCODE"
    " "
    SUM UNIT_SOLD AND RETURNS AND COMPUTE
    RATIO/D5.2 = 100 * RETURNS/UNIT_SOLD;
    BY PROD_CODE
    IF PROD_CODE IS-FROM &BEGCODE TO &ENDCODE
    IF CITY EQ &CITY
    FOOTING CENTER
    "REGION MANAGER: &REGIONMGR"
    "CALCULATED AS OF &DATE"
    END

The example processes as follows:

  1. The -SET sets a default value for &CITY:

     FOR WHICH CITY DO YOU WANT A REPORT?

  2. -CRTFORM generates the screen form:

    YEARLY SALES REPORT FOR STAMFORD
    DATE: 02/22/2003    TIME: 13.42.38
     
    ENTER BEGINNING PRODUCT CODE RANGE:
    ENTER ENDING PRODUCT CODE RANGE:
    ENTER NAME OF REGIONAL SUPERVISOR:

  3. The transaction value for &CITY is Stamford, the value that was previously supplied in the -SET statement.
  4. Note that the variables &DATE and &DATEMDYY are system variables. The values are supplied by the system and displayed on the form.


x
Controlling the Use of PF Keys

In this section:

Reference:

The terminal operator can use certain PF keys to control the execution of a FIDEL application. Normally, the following keys are used:

Note: All other keys return the value of the PF key when pressed.

Several facilities are available to assist you in controlling various screen operations:



x
Reference: Default Settings for PF Keys

The default PF key settings are as follows:

PF Key

Function

PF01

HX

PF02

CANCEL

PF03, PF15

END

PF04, PF16

RETURN

PF05, PF17

RETURN

PF06, PF18

RETURN

PF07, PF19

BACKWARD

PF08, PF20

FORWARD

PF09, PF21

RETURN

PF10, PF22

RETURN

PF11, PF23

RETURN

PF13

RETURN

PF12, PF24

UNDO

PF14

RETURN

You can display the current PF key settings by issuing the FOCUS query command:

? PFKEY

This displays a formatted table of all the current values.



x
Resetting PF Key Controls

You can reset PF key functions in FIDEL for both CRTFORMs and -CRTFORMs using the FOCUS SET command with the following syntax

SET PFxx = function

where:

xx

Is a one or two-digit PF key number.

function

Is one of the following:

END in MODIFY, exits the procedure; in Dialogue Manager, is equivalent to QUIT. That is, END exits the procedure.

CANCEL in MODIFY, cancels the transaction and returns to the TOP case. Do not use the CANCEL setting in Dialogue Manager.

FORWARD pages forward.

BACKWARD pages backward.

RETURN has no specific screen action. Returns the PF key name in the PFKEY field because it is not yet defined. To set the PFKEY field, use COMPUTE in MODIFY or -SET in Dialogue Manager.

HELP displays text supplied with the HELPMESSAGE attribute for any field on the MODIFY CRTFORM. Position the cursor on the data entry area of the desired field, and press the PF key you have defined for HELP. If no help message exists for that field, the following message is displayed:

NO HELP AVAILABLE FOR THIS FIELD.

The following example sets the PF03 key for paging backward and the PF04 key for paging forward:

SET PF03=BACKWARD,PF04=FORWARD

Note: When changing PF key settings, make sure that at least one key is set to END. If you set a PF key to FORWARD, you should also set one to BACKWARD.



x
Setting PF Key Fields for Branching Purposes

You can create a menu of processing options. The operator can then indicate a choice by pressing a particular PF key. To assign a specific processing function to a PF key, you must specify a field named PFKEY. Which PF key the operator presses determines the value of the PFKEY field.

You can use the PF keys designated as Return keys, as well as the Enter key. You define a variable called PFKEY (in MODIFY) or &PFKEY (in Dialogue Manager) and then test its value after the CRTFORM is displayed. Which branch takes place depends on which PFKEY the operator presses.

In MODIFY, the syntax is

COMPUTE
PFKEY/A4=;

where:

PFKEY/A4

Is a four-character field, whose value is determined by which key the operator presses at run time.

In Dialogue Manager, the syntax is

-SET &PFKEY='  ';

where:

&PFKEY

Is a four-character field, whose value is determined by which key the operator presses at run time.

=' ';

Is the allocation of four character spaces for the field.

The following example shows how PF keys can be tested in MODIFY:

 
1.  COMPUTE
    PFKEY/A4=; 
2.  CRTFORM
       "SELECT OPTION"
       "INPUT   PRESS PF4"
       "UPDATE  PRESS PF5"
       "DELETE   PRESS PF6" 
3.  IF PFKEY EQ 'PF04' GOTO INCASE
       ELSE IF PFKEY EQ 'PF05' GOTO UPCASE
       ELSE IF PFKEY EQ 'PF06' GOTO DELCASE
       ELSE GOTO TOP;
            .
            .
            .

The example processes as follows:

  1. The COMPUTE statement specifies a four-character field PFKEY.
  2. CRTFORM generates the form which supplies the operator with three options:

    SELECT OPTION
    INPUT   PRESS PF4
    UPDATE  PRESS PF5
    DELETE  PRESS PF6

  3. The IF test determines what case to branch to depending on the value of the PFKEY field. For example, if the operator presses PF4, the value for PFKEY is PF04, and the request branches to an input case INCASE.


x
Specifying Screen Attributes

In this section:

Screen attributes (such as highlighting, colors, and so on) can be applied to the fields on the CRTFORM and the -CRTFORM. They can also be used as background effects and can be applied to the fields depending on the result of tests.

The following attributes are available on 3270 IBM terminals:

Function

Abbreviation

Short Name

Flash or Blink

F

FLAS or BLIN

Underline

U

UNDE

Invert or Reverse Video

I

INVE or REVV

Clear*

C

CLEA

Blue

B

BLUE

Red

R

RED

Pink

P

PINK

Green

G

GREE

Aqua

A

AQUA

Turquoise

T

TURQ

Yellow

Y

YELL

White

W

WHIT

Nodisplay*

N

NODI

Return to default

$

$

Highlight or Intensify*

H

HIGH or INTE

Note:

When an attribute is unsupported on a particular terminal or is specific to a version of FOCUS under another operating system, the attribute is ignored. Therefore, there is no need for code changes between terminals and/or operating systems.

To use the screen attributes other than C, N, and H you must notify FOCUS that your terminal is equipped to display them. Issue the FOCUS SET command:

SET EXTTERM=ON

This allows a procedure to be operated on a variety of terminals. FOCUS automatically detects a 3279 model terminal and sets EXTTERM to ON by default.

If your terminal does not properly recognize extended attributes, due to a "terminfo" compatibility problem, stray characters will appear on your screen. You may turn off extended attribute recognition with the command:

SET EXTTERM=OFF

Programs with extended attributes and EXTTERM=OFF will run as if extended attributes had not been coded in the program.

Make sure that your terminal has the extended attribute options needed before you turn EXTTERM on. There are many different IBM 3270 models. Generally, the color terminals in the 3279 series have most of the options. However, even if a terminal has the physical capability to support all of the attributes, it may be defined to the operating system as a lower grade terminal. In such cases, you must ascertain whether or not all the attributes can be used.

The syntax for defining screen attributes in MODIFY is

<[:label][.attribute.]field[>]

The syntax for defining screen attributes in Dialogue Manager is

<[&:label][.attribute.]&variable[>]

where:

.attribute.

Is one or more of the attributes. Note the dots (periods) before and after each attribute or entry in an attribute list.

field

Names the field to which the attributes apply.

&variable

Names the variable field to which the attributes apply.

Note: Labels and their use are discussed in Using Labeled Fields.

The following chart shows you how to use these attributes in conjunction with prefixes (D. and T.), where X is the name of a field or variable:

.HT.X

Highlighted T.

.CT.&X

Unhighlighted T.

.N.X

Nodisplay entry, (for example, for passwords)

.H.&X

Highlighted entry

.C.X

Unhighlighted entry

.HD.X

Highlighted D.

The following usage considerations apply when using screen attributes:

Note the following examples:

.AID.

Aqua inverted display field.

<.RED.FLASH.

Red flashing field.

<.RED.FLAS.

Red flashing field.

<.PIN.

Inverted pink field (color overrides).

<I.YELL.

Inverted yellow field.



x
Using Background Effects

If a field is absent, the attribute affects the protected portion of the screen; that is, the text. Both a beginning and ending dot as well as a space between the attribute and the text are needed. For example:

"<.RED. ENTER EMP_ID:"

This will print the words ENTER EMP_ID: in red. Note the space between .RED. and ENTER EMP_ID:. A right caret may also be inserted for clarity.

The line:

"<.INVE.RED.   <.CLEAR.EMP_ID"

will turn the background color to red. CLEAR changes the background for the input field EMP_ID back to black.

An attribute stays in effect until another attribute changes it on a physical screen. Therefore, if <.INVE.RED. is in the upper left corner, the entire screen will be in inverse red unless some other background attribute is provided later. In the example above, the <.CLEAR is used to limit the effect to one area.

Note: .CLEAR. and .HIGH. only work when they are used in conjunction with a field. They do not work alone or simply with text.


Top of page

x
Using Labeled Fields

In this section:

You can use labels to identify a specific field on the screen. They are necessary to perform the following functions:

The syntax for a labeled field in MODIFY is

<:label.field

The syntax for a labeled field in Dialogue Manager is

<&:label.&variable

where:

<[&]:label.

Is a user-defined label. It starts with a colon (:) and may be up to 66 characters long including the colon. You may not use embedded blanks.

field

Is any field on the CRTFORM. It can be a field created specifically for appending a label.

&variable

Is any variable field on the CRTFORM. It can be a field created specifically for appending a label.

The following rules apply:



Example: Using a Labeled Field With MODIFY

For example, in MODIFY:

COMPUTE
:ONE/A6='   ';
CRTFORM
"<:ONE.EMP_ID"

The label :ONE is set to a format of A6 and is the identifier of the field EMP_ID.



Example: Using a Labeled Field With Dialogue Manager

For example, in Dialogue Manager:

-SET &:ONE='  ';
-CRTFORM
-"<&:ONE.&CITY/10"

In this Dialogue Manager example, the label &:ONE is set to a format of A4 and is the identifier of the field &CITY.

Note: When you are dealing with many complex labels and attributes, we advise you to use the FOCUS Screen Painter which allows you to do everything without learning the detailed syntax (see Using the FOCUS Screen Painter).



x
Dynamically Changing Screen Attributes

The screen attributes in a FIDEL form can be changed during the course of the terminal session in which they are defined. This allows you to design easy-to-read and easy-to-use procedures. For instance, after an error occurs, you can turn a specific field into flashing red to alert the operator.

The mechanism for changing the attribute is to put a label before the field. Then, issue a COMPUTE in MODIFY, or a -SET in Dialogue Manager, to assign the label new attribute values. When the screen is next displayed, it takes on the characteristics of the provided attributes.

The following example shows how to use a COMPUTE in MODIFY to dynamically change an attribute value:

COMPUTE
 :ATTRIB/A12=IF CURR_SAL GT 50000 THEN 'FLASH' ELSE '$';
CRTFORM
 "AMOUNT <:ATTRIB.T.CURR_SAL>"
IF CURR_SAL GT 50000 GOTO TOP ELSE GOTO OTHER;
 .
 .
 .

This generates an attribute value for the label ATTRIB. If the CURR_SAL is greater than 50,000, the field will flash; otherwise, it observes the default setting.

The following example shows the use of a -SET statement to assign an attribute value in Dialogue Manager:

-SET &AMOUNT=0;
-SET &:ATTRIB='     ';
-TOP
-CRTFORM
-"AMOUNT: <&:ATTRIB.T.&AMOUNT>"
-SET &:ATTRIB=IF &AMOUNT GT 100 THEN 'FLASH' ELSE '$';
-IF &AMOUNT GT 100 GOTO TOP;
 .
 .
 .

This generates an attribute value for the label &:ATTRIB, changing &AMOUNT to flashing if the value is greater than 100. Be sure to use -SET to establish the label in the beginning of the procedure.

Note: When you use CRTFORMs in either MODIFY or Dialogue Manager, the labels you assign must precede the fields with which they are associated; labels cannot occur by themselves. Use COMPUTE statements to dynamically change screen text attributes, setting the label equal to the COMPUTE (see previous example).

You can convert a T. field to a D. field dynamically; however, you cannot convert a D. field to a T. field. The method for changing turnaround fields to display fields is the same as that for changing screen attributes dynamically.

    MODIFY FILE EMPLOYEE 
1.  CRTFORM 
2.  "SALARY UPDATE" 
2.  " " 
3.  "EMPLOYEE ID #: <.INVE.EMP_ID LAST NAME: <0X
    <.CLEAR.D.LAST_NAME" 
4.  MATCH EMP_ID
       ON NOMATCH REJECT 
5.     ON MATCH CRTFORM LINE 10 
6.     ENTER SALARY"
       " "
       "SALARY: <:HERE.T.CURR_SAL>" 
7.  COMPUTE
       :HERE/A12=IF CURR_SAL GT 100000 THEN 'D' ELSE 'T';
       IF CURR_SAL GT 100000 GOTO TOP;
       ON MATCH UPDATE CURR_SAL
    DATA
    END

This procedure constructs a form to update salaries. It processes as follows:

  1. CRTFORM generates the screen form and invokes FIDEL.
  2. Provide text for the CRTFORM; empty quotation marks indicate a blank line on the form.
  3. The next two lines contain the following screen elements:
    EMPLOYEE ID #:

    Is text describing the conditional data field EMP_ID.

    .INVE.

    Is a screen attribute that displays the field EMP_ID in reverse video.

    LAST NAME:

    Is text describing the field LAST_NAME.

    .CLEAR.

    Is a screen attribute that clears the .INVE. attribute, returning the D. (display-only) field LAST_NAME to the default display.

  4. The request continues with MODIFY MATCH logic.
  5. If EMP_ID matches, another CRTFORM is generated on line 10 of the same screen.
  6. The next three lines contain the following screen elements:
    ENTER SALARY:

    Is text describing the CURR_SAL field.

    " "

    Generates a blank line.

    :HERE

    Is a label identifying the CURR_SAL field.

  7. This COMPUTE evaluates the field CURR_SAL and defines it as a turnaround (T.) field or a display (D.) field, depending on the value of CURR_SAL. If the salary is greater than 100,000, the field is a display field (and cannot be updated); if the salary is less than 100,000, the field is a turnaround field (and can be updated).

The resulting CRTFORM is as follows:

SALARY UPDATE
 
EMPLOYEE ID #:     LAST NAME:
 
 
 
 
 
 
 
ENTER SALARY
 
SALARY:


x
Specifying Cursor Position

To specify cursor position, simply choose the field where you want the cursor positioned. You may specify the field by its field name or by its label. You can set the cursor at a specific place on the screen by computing or setting the value of the field CURSOR (in MODIFY) or &CURSOR (in Dialogue Manager).

The syntax for the field which controls the cursor position in MODIFY is

COMPUTE
CURSOR/A66= expression;

where:

CURSOR/A66

Is a 66-character alphanumeric field.

expression

Is terminated with a semicolon and can be anything, including the full field name, its full alias, or a unique truncation of either, or the label itself. This determines the position of the cursor.

For example:

COMPUTE
CURSOR/A66=IF TESTNAME GT 100 THEN 'EMP_ID'
ELSE 'LAST_NAME';

The position of the cursor will be on the field EMP_ID if the value of test name is greater than 100, or it will be on the field LAST_NAME if test name is less than or equal to 100.

You may also position the cursor using a field label. For example:

COMPUTE
CURSOR/A66=IF TESTNAME GT 100 THEN ':ONE'
ELSE ':TWO';

Note: If the field name is not unique, FIDEL uses the first occurrence of the field name (going from left to right across each line and then down to the next line) to set or test the cursor position.

In MODIFY, the variable CURSORINDEX can also be used to compute the position of the cursor at a particular record when there are multiple indexed records displayed in a single CRTFORM. This feature is commonly used for placing the cursor on invalid fields after VALIDATE statements. The syntax is

COMPUTE
CURSORINDEX/I5=expression;

where:

CURSORINDEX/I5

Is a five-digit integer field. Refers to the current value of the subscript being processed from the CRTFORM.

expression

May be any expression, but in most applications will be set equal to REPEATCOUNT.

Note: See Case Logic, Groups, CURSORINDEX and VALIDATE for a full example of the use of CURSORINDEX using Case Logic, multiple fields and the VALIDATE subcommand. Also, multiple record processing is discussed in full in Multiple Record Processing.

In Dialogue Manager, the syntax for positioning the cursor is

-SET &CURSOR=expression; 

where:

&CURSOR

Is a variable specifically referring to the position of the cursor.

expression

Is terminated with a semicolon and can be any valid expression including the field name or label itself. It determines the position of the cursor.

The following example illustrates the positioning of the cursor on the screen in Dialogue Manager using labeled fields:

1.  -SET &:AAA = '    ';
    -SET &:BBB = '    '; 
2.  -PROMPT &YR.PLEASE ENTER YEAR NEEDED. 
3.  -SET &CURSOR = IF &YR GT 1984 THEN ':AAA' ELSE ':BBB';
    -* 
4.  -CRTFORM
    -"MONTHLY REPORT FOR THE CITY <&:AAA.&CITY/10"
    -"YEARLY REPORT FOR THE AREA <&:BBB.&AREA/1"
        .
        .
        .

This processes as follows:

  1. Two -SET statements declare the labels, which are themselves variables.
  2. The -PROMPT statement prompts the operator for a value for &YR.
  3. The -SET statement sets an IF test as the value for the variable &CURSOR. If the value of &YR is greater than 1984, the position of the cursor is set to the label :AAA; otherwise, it is set to the label :BBB.
  4. If the operator supplies the value 85 for &YR, the visual form generated is as follows, and the cursor is positioned at the variable &CITY:

    MONTHLY REPORT FOR THE CITY
    YEARLY REPORT FOR THE AREA

The remainder of the FOCEXEC might then branch to a TABLE request for a monthly report for that city. Had the year been earlier than 84, the cursor would have been positioned on AREA. The branch might then be to a TABLE request for a yearly report for that area.

Caution: In Dialogue Manager, be sure to set &CURSOR to the label name without the & (ampersand). Use :AAA, not &:AAA.



x
Determining Current Cursor Position for Branching Purposes

Rather than having the operator type a response, you can create a menu on which you list options. To select an option, the operator moves the cursor to the correct line on the screen and presses the Enter key. FOCUS senses the cursor position and takes action based upon it (such as branching to a particular case or field).

To do this, you must specify a 66 character field that contains the current cursor position, CURSORAT. You may identify a field on the screen by a label or by its field name.

The syntax that defines the field used to read the cursor position in MODIFY is

COMPUTE
CURSORAT/A66=;

where:

CURSORAT/A66

Is the field whose value is determined by the field name, or label of the field, on which the cursor is positioned when the operator presses Enter.

In Dialogue Manager, the syntax is

-SET &CURSORAT='      ';

where:

&CURSORAT

Is a variable whose value is determined by the field name, or label of the field, on which the cursor is positioned when the operator presses Enter.

If the actual cursor position is not on any field, the value of CURSORAT is the nearest preceding field. If there are no preceding fields, the value of CURSORAT is the TOP of the CRTFORM. That is, the value is at the very beginning of the CRTFORM.

In the following example, field XYZ is a computed field for the purpose of creating a labeled field wherever necessary on the CRTFORM:

    MODIFY FILE EMPLOYEE 
1.  COMPUTE
    CURSORAT/A66=; 
2.  :ADD/A1=;
    :UPP/A1=; 
3.  XYZ/A1=; 
4.  CRTFORM
       "POSITION CURSOR NEXT TO OPTION DESIRED"
       "THEN PRESS ENTER"
       " "
       "<:ADD.XYZ   ADD RECORDS"
       "<:UPP.XYZ   UPDATE RECORDS" 
5.  IF CURSORAT EQ ':ADD' GOTO ADD ELSE
    IF CURSORAT EQ ':UPP' GOTO UPP ELSE GOTO TOP;
 
     CASE ADD
    CRTFORM LINE 1
       "THIS CRTFORM ADDS RECORDS"
       " "
       "EMPLOYEE ID #: <EMP_ID"
       "LAST NAME:     <LAST_NAME"
       "FIRST NAME:    <FIRST_NAME"
       "HIRE DATE:     <HIRE_DATE"
       "DEPARTMENT:    <DEPARTMENT"
    MATCH EMP_ID
       ON MATCH REJECT
       ON NOMATCH INCLUDE
    ENDCASE
 
    CASE UPP
    CRTFORM LINE 1
       "THIS CRTFORM UPDATES RECORDS"
       " "
       "EMPLOYEE ID #: <EMP_ID"
       "DEPARTMENT:    <DEPARTMENT"
       "JOB CODE:      <CURR_JOBCODE"
       "SALARY:        <CURR_SAL"
    MATCH EMP_ID
       ON NOMATCH REJECT
       ON MATCH UPDATE DEPARTMENT CURR_JOBCODE CURR_SAL
    ENDCASE
    DATA
    END

This example processes as follows:

  1. The COMPUTE establishes the field CURSORAT.
  2. The second and third COMPUTEs declare the labels :ADD and :UPP.
  3. The third COMPUTE establishes a field XYZ for the purpose of using labels.
  4. CRTFORM generates the following visual form beginning on the first line of the screen:

    POSITION CURSOR NEXT TO OPTION DESIRED
    THEN PRESS ENTER
     
    ADD RECORDS
    UPDATE RECORDS

  5. An IF phrase tests the value of the field CURSORAT. If the operator places the cursor next to ADD RECORDS, the value of CURSORAT is :ADD and a branch to Case ADD will be performed. If the operator places the cursor next to UPDATE RECORDS, the value of CURSORAT is :UPP and Case UPP will be performed.


x
Annotated Example: MODIFY

The following example illustrates the syntax for a MODIFY CRTFORM using dynamically changing attributes:

MODIFY FILE EMPLOYEE 
1. CRTFORM 
2. "EMPLOYEE UPDATE" 
3. "</1" 
4. "EMPLOYEE ID #: <.INVE.EMP_ID"
GOTO UPDATE
CASE UPDATE 
5. MATCH EMP_ID
ON NOMATCH REJECT 
6. ON MATCH CRTFORM LINE 1
" " 
7. "LAST NAME: <.INVE.T.LAST_NAME"
"DEPARTMENT: <.CLEAR.T.DEPARTMENT>"
"SALARY: <:ATTRIB.T.CURR_SAL>" 
8. ON MATCH COMPUTE
:ATTRIB/A12 = IF CURR_SAL GT 50000 THEN 'FLASH.INVE';
MSG/A60 = IF CURR_SAL GT 50000 THEN 'PLEASE REENTER' ELSE ' ';
ON MATCH TYPE "<MSG"
ON MATCH IF CURR_SAL GT 50000 GOTO UPDATE;
ON MATCH UPDATE LAST_NAME DEPARTMENT CURR_SAL
ENDCASE
DATA
END

This procedure sets up a form to update the department and current salary. It processes as follows:

  1. CRTFORM generates the visual form and invokes FIDEL.
  2. This line contains a screen element set between double quotations marks. It is a line of descriptive text.
  3. This line contains another screen element, a spot marker that skips one line.
  4. These lines contain four screen elements—'EMPLOYEE ID #:' is text describing the field; the field EMP_ID is described as a conditional data entry field. The contents will be displayed in reverse video because .INVE. is a screen attribute defining the field.

    The visual form generated is as follows:

    EMPLOYEE UPDATE
    EMPLOYEE ID #: (reverse video)

    Enter Employee ID # 818692173.

  5. The request continues with MODIFY MATCH logic.
  6. If the EMP_ID matches, another CRTFORM is generated. It is placed on LINE 1 and thus replaces the previous CRTFORM on the screen.
  7. The CRTFORM defines three turnaround fields:

    The LAST_NAME field. The .INVE. attribute displays the field in reverse video.

    The DEPARTMENT field. The .CLEAR. attribute displays the field in regular video.

    The CURR_SAL field. The appearance of the field value depends on the value of the :ATTRIB field. When the CURR_SAL value first appears, the :ATTRIB field is empty and the value appears in regular video. If you enter a CURR_SAL value greater than 50,000, the :ATTRIB field receives the attribute FLASH.INVE, displaying the CURR_SAL value in flashing inverse (or reverse) video. The CRTFORM appears as follows:

    LAST NAME:   CROSS
    DEPARTMENT:  MIS
    SALARY:      27062.00

  8. If the CURR_SAL field value is greater than 50,000 when you press Enter, the COMPUTE statement assigns the :ATTRIB label the FLASH.INVE attribute.
  9. If the CURR_SAL field value is greater than 50,000 when you press Enter, the IF statement branches back to the CASE UPDATE statement. This displays the second CRTFORM with the CURR_SAL value in reverse video.

    Note: If you are using a terminal emulator you may not be able to view the attribute FLASH.INVE.



x
Annotated Example: Dialogue Manager

The following sample -CRTFORM illustrates the syntax for dynamic control of attributes in Dialogue Manager:

 
1.  -PROMPT &CITY.FOR WHICH CITY DO YOU WANT A REPORT?. 
2.  -SET &:ATTRIB = IF &CITY EQ STAMFORD THEN 'INVE' ELSE 'CLEAR';
    -* 
3.  -CRTFORM 
4.  -"MONTHLY SALES REPORT" 
5.  -"Date: <D.&DATE      Time: <D.&TOD" 
6.  -"Beginning Code is:  <&:ATTRIB.&BEGCODE/3"
    -"Ending Code is:   <&:ATTRIB.&ENDCODE/3"
    -"Regional Supervisor is:  <&:ATTRIB.&REGIONMGR/15"
    TABLE FILE SALES
    HEADING CENTER
    "MONTHLY REPORT FOR &CITY"
    "PRODUCT CODES FROM &BEGCODE TO &ENDCODE"
    " "
    SUM UNIT_SOLD AND RETURNS AND COMPUTE
    RATIO/D5.2 = 100 * RETURNS/UNIT_SOLD;
    BY PROD_CODE
    IF PROD_CODE IS-FROM &BEGCODE TO &ENDCODE
    IF CITY EQ &CITY
    FOOTING CENTER
    "REGION MANAGER: &REGIONMGR"
    "CALCULATED AS OF &DATE" 
7.  END

The example processes as follows:

  1. The -PROMPT prompts the operator for a value for &CITY.
  2. The -SET statement sets the label :ATTRIB to INVE if the city is Stamford, causing each field labeled :ATTRIB in the remainder of the -CRTFORM to be displayed in reverse video.
  3. -CRTFORM generates the visual form and invokes FIDEL.
  4. The first line of the screen form contains text.
  5. The second line contains the current date and time as display fields. Since they are in protected areas of the screen, they cannot be altered.
  6. Each of the next three lines contains descriptive text and one field. Each field has a label which displays the field in reverse video if the city is Stamford.

    The screen displays the following -CRTFORM:

    MONTHLY SALES REPORT
    Date: 01/08/97    Time: 10:50:16
    Beginning Code is:
    Ending Code is:
    Regional Supervisor is:

  7. After the operator presses Enter, the values entered in the screen form are sent to the variables. The TABLE request executes when END is encountered.

Information Builders