In this section: |
FIDEL works with all the standard Dialogue Manager facilities. However, the following differences apply when you use FIDEL with Dialogue Manager:
You must define the length of variable fields in -CRTFORMs. The length of Dialogue Manager variables can be defined in one of two ways:
<&variable/length
where:
Is a number representing the alphanumeric length of the variable.
-SET &variable = ' ' ;
where:
Represents the alphanumeric length of the variable.
Note:
-CRTFORM BEGIN indicates that the form is being built. This Dialogue Manager control statement enables you to use other Dialogue Manager control statements between the screen lines without causing the CRTFORM to end. This is necessary when you are using indexed variables in a looping procedure.
-CRTFORM END terminates the form and causes the display of the assembled form.
The following is an example of the use of indexed variables in -CRTFORM. The variable &LINENUM is the indexed variable in the -CRTFORM. The index, &I, is set to increment by 1 each time a line is written. After the 10th line, the -CRTFORM ends. Note the use of the Dialogue Manager label, -BUILD and the -SET statement to control the loop within the form:
1. -SET &I = 0; 2. -CRTFORM BEGIN -"THE FOLLOWING FORM STORES 10 LINES OF TEXT" -" " 3. -BUILD 4. -SET &I = &I + 1; 5. -SET &LINENUM.&I = 'LINE ' | &I; 6. -"<D.&LINENUM.&I <&LINE.&I/60" 7. -IF &I LT 10 GOTO BUILD; 8. -CRTFORM END -* -TYPE LINE #2 CONTAINS THE FOLLOWING TEXT: -TYPE 9. -TYPE &LINE2
This example processes as follows:
THE FOLLOWING FORM STORES 10 LINES OF TEXT LINE 1 LINE 2 LINE 3 LINE 4 LINE 5 LINE 6 LINE 7 LINE 8 LINE 9 LINE 10 |
Type any text you wish onto the lines.
The statement -CRTFORM both initiates the screen form and automatically clears the screen. The screen form begins at the top of the screen.
After the operator enters values for the variables and presses Enter, the variables are supplied with the values and the screen is cleared.
By default, FOCUS reserves the last four lines of the Dialogue Manager terminal screen for TYPE messages. You can change this by using the keyword TYPE to determine the number of lines each CRTFORM reserves for messages. This feature allows you to increase the number of lines on the screen for CRTFORM display and reduce the number of lines reserved for messages at the bottom of the screen. The syntax is
-CRTFORM TYPE {n|4}
where:
Is a number from 1 to 4 indicating the number of message lines desired. The TYPE value setting remains in effect for all subsequent CRTFORMs in the same procedure until overridden by a new value. The default is 4.
You can expand the CRTFORM screen size by specifying a number less than 4. For example, a terminal with a height of 24 lines reserves 20 lines for the CRTFORM and four lines for the TYPE area. If you specify a TYPE area of 2, the CRTFORM area increases to 22 lines.
The following FOCEXEC is an example of a TABLE request incorporating the use of -CRTFORM.
-* Component Of Retail Sales Reporting Module 1. SET &LIST = 'STAMFORD,UNIONDALE,NEWARK'; 2. PROMPT &CITY.(&LIST).ENTER CITY.: -* 3. -CRTFORM -"Monthly Sales Report For <D.&CITY" -"Date: <D.&DATE Time: <D.&TOD" -" " -"Beginning Product Code is: <&BEGCODE/3" -"Ending Product Code is: <&ENDCODE/3" -"Regional Supervisor is: <®IONMGR/15" -"Title For UNIT_SOLD is: <&UNIT_HEAD/10" 4. TABLE FILE SALES HEADING CENTER MONTHLY REPORT FOR &CITY" "PRODUCT CODES FROM &BEGCODE TO &ENDCODE" SUM UNIT_SOLD AS &UNIT_HEAD 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: ®IONMGR" "CALCULATED AS OF &DATE" 5. END
The following is a sample of the dialogue between the screen and the operator. Operator entries are in lowercase.
ENTER CITY: boston PLEASE CHOOSE ONE OF THE FOLLOWING: STAMFORD,UNIONDALE,NEWARK ENTER CITY: stamford |
Monthly Sales Report for STAMFORD Date: 01/08/2003 Time: 13.12.41 Beginning Product Code is: b10 Ending Product Code is: b20 Regional Supervisor is: smith Title For UNIT_SOLD is: sales |
TABLE FILE SALES HEADING CENTER "MONTHLY REPORT FOR STAMFORD" "PRODUCT CODES FROM B10 TO B20" " " SUM UNIT_SOLD AS SALES AND RETURNS AND COMPUTE RATIO/D5.2 = 100 * RETURNS/UNIT_SOLD; BY PROD_CODE IF PROD_CODE IS-FROM B10 TO B20 IF CITY EQ STAMFORD FOOTING CENTER "REGION MANAGER: SMITH" "CALCULATED AS OF 01/08/2003" END
PAGE 1 MONTHLY REPORT FOR STAMFORD PRODUCT CODES FROM B10 TO B20 PROD_CODE SALES RETURNS RATIO --------- ------ ------- ----- B10 60 10 16.67 B12 40 3 7.50 B17 29 2 6.90 REGION MANAGER: SMITH CALCULATED AS OF 11/04/03
|
Information Builders |