In this section: |
Reference: |
You can use the FOCUS integrated text editor, TED, or invoke your system editor from FOCUS with the IEDIT command to create procedures that contain Dialogue Manager functionality. IEDIT is especially useful with variable length files or those whose record lengths are greater than 80 characters.
TED and IEDIT have two valuable features for creating and editing procedures:
For details, see Editing Files With TED and Invoking Your System Editor With IEDIT in the Overview and Operating Environments manual.
These options complement the FILE and SAVE options that are common to other editors.
In addition to Dialogue Manager commands and variables that directly affect an application's flow of control, you can use commands to:
You can also create a profile procedure that defines startup conditions and can include Dialogue Manager commands. See Creating a Startup Procedure.
Follow these general rules when creating procedures:
How to: |
Include comments in a procedure for the benefit of others who may use it. It is particularly recommended that you use comments in a procedure heading to supply the date, the version, and other relevant information. A hyphen and an asterisk (-*) mark the beginning of a comment.
Comments do not appear on the terminal nor do they trigger processing. They are visible only when viewing the contents of the procedure through the editor and are strictly for the benefit of the developer. However, you can view comments on the terminal by using the &ECHO variable. For details, see Debugging a Procedure.
-*
You can place a comment at the beginning or end of a procedure or in between commands. A comment cannot be on the same line as a command.
The following entry is valid:
. . . -*Version 2 06/10/00 -RUN
The following is invalid:
-RUN -*Version 2 06/10/00
The following example places a comment at the beginning of a procedure.
-* Version 1 08/26/02 HRINFO Procedure TABLE FILE CENTHR . . .
How to: |
You can use the -TYPE command to send a message to the terminal while a procedure is processing. Typically, the message serves the following purposes:
-TYPE sends the message to the terminal as soon as it is encountered in the processing of a procedure. The syntax is
-TYPE[+|0|1] text
or
-label TYPE text
where:
Is the message to be sent. The message is sent to the screen, followed by a line feed. It remains on screen until scrolled off or replaced by a new screen.
If you include quotation marks around the text, they are displayed as part of the message. (This differs from the use of TYPE in MODIFY, where quotation marks are used as delimiters and must enclose informative text.)
Is the target of a -GOTO or -IF.
Are optional entries that pass printer control characters to the output device. They are particularly useful for character printers. Options + and 1 do not work on IBM 3270-type terminals.
+ suppresses the line feed following the printing of text.
0 forces a line feed before the message text is displayed.
1 forces a page eject before the message text is printed.
If supplied, these values must follow -TYPE without a space.
The following example illustrates the use of -TYPE to inform a user about the content of a report:
-* Version 1 06/26/00 SLRPT Procedure -* Component of Retail Sales Reporting Module -TYPE This report calculates percentage of returns. TABLE FILE SALES . . . END
How to: |
You can issue and control passwords with the -PASS command. This is especially useful for specifying a password for a particular file or set of files that a given user can read from or write to. Passwords have detailed sets of functions associated with them through the DBA facility.
The procedure that sets passwords can be encrypted so that it and the passwords that it sets cannot be typed and made known.
A variable can also be associated with -PASS so that you can prompt for and assign a password value. You can also check the value of the password and skip or execute a portion of the procedure depending on the value.
-PASS password
where:
Is a password or a variable containing a password.
Since -PASS is a Dialogue Manager command, it executes immediately and is not sent to the FOCSTACK. This means that the user need not issue the password with the SET command.
You can establish startup conditions in a profile that executes its content immediately upon entry into FOCUS. Using this procedure you can:
You can create a profile using any text editor or the FOCUS editor TED. The file is a procedure (FOCEXEC) named PROFILE.
Note: It is possible to use an alternate procedure as a profile or not to execute a profile at all. For more information, see the Overview and Operating Environments manual.
The following example creates a startup profile):
USE SALES EMPLOYEE END DYNAM ALLOC DD MYSAV DA USER1.SAVE.TEMP SHR REU DEFINE FILE SALES RATIO/D5.2 = (RETURNS/UNIT_SOLD); END -TYPE FOCUS SESSION ON &DATE MDYY &TOD
LET WORKREPORT=TABLE FILE EMPLOYEE SET LINES=57, PAPER=66, PAGE=OFF OFFLINE
Upon entering FOCUS, the profile is executed and a message, introduced by the -TYPE command, displays the current date and time.
|
Information Builders |