Examples of Prompting
The following examples apply to using formatted and unformatted prompting when entering or amending an RDML program:
Example 1. Formatted Prompting
Starting display:
No Act Lbl Command Parameters1 P L10 REQUEST FIELDS(#ORDER)___________________
2 __ ___ INSERT FIELDS(#ORDER #PRODNO #QUANTITY) _
3 __ ___ ________ TO_FILE(ORDERS____________________
4 __ ___ GOTO L10_______________________________
Resulting display 1- Formatted prompt of REQUEST command:
Formatted display request (REQUEST) Prompt +++
Enter the following:
Fields and attributes list : FIELDS P
Field name : #ORDER
Field control attribute 1 : ___________
2 : ___________
3 : ___________
4 : ___________
5 : ___________
6 : ___________
7 : ___________
+ for more
Dflt field design method: DESIGN P *IDENTIFY
Dflt identification method: IDENTIFY P *DESIGN
Down/vertical separation: DOWN_SEP P *DESIGN
Across/horizontal sep: ACROSS_SEP P *DESIGN
Name of browse list: BROWSELIST P *NONE
EXIT key control EXIT_KEY P
Enable the EXIT key: *YES
If EXIT key used, goto: *EXIT
MENU key control MENU_KEY P
Enable the MENU key: *YES
If MENU key used, goto: *MENU
If you make these changes:
Dflt field design method: DESIGN P *IDENTIFY
Dflt identification method: IDENTIFY P *COLHDG
Down/vertical separation: DOWN_SEP P *DESIGN
Across/horizontal sep: ACROSS_SEP P 10
Name of browse list: BROWSELIST P *NONE
EXIT key control EXIT_KEY P
Enable the EXIT key: *NO
If EXIT key used, goto: *EXIT
MENU key control MENU_KEY P
Enable the MENU key: *NO
If MENU key used, goto: *MENU
Resulting display 2 - Re-display of RDML program after changes:
No Act Lbl Command_Parameters1 __ L10 REQUEST FIELDS(#ORDER) IDENTIFY(*COLHDG)
2 __ ____ _______ ACROSS_SEP(10)_________________
3 __ ___ _______ EXIT_KEY(*NO) MENU_KEY(*NO)____
4 __ ___ INSERT IELDS(#ORDER #PRODNO #QUANTITY)
5 __ ____ _______ TO_FILE(ORDERS)________________
6 __ ___ GOTO L10____________________________
Example 2. Unformatted Prompting
Starting display:
No Act Lbl Command Parameters
1 __ L10 REQUEST FIELDS(#ORDER)__________________
2 U ___ INSERT FIELDS(#ORDER #PRODNO #QUANTITY)
3 __ ___ __________ TO_FILE(ORDERS)_________________
4 __ ___ GOTO L10_____________________________
Resulting display 1 - Unformatted prompt of the INSERT command:
Insert new record into file (INSERT) prompt:
FIELDS(#ORDER #PRODNO #QUANTITY) TO_FILE(ORDERS)____
____________________________________________________
____________________________________________________
Resulting display 2 - User changes the command:
Insert new record into file (INSERT) prompt
FIELDS(#ORDER #PRODNO #QUANTITY #DATDUE #TOTAL #ADD1
#ADD2 #ADD3 #ADD4 #TOTLIN) TO_FILE(ORDERS)__________
VAL_ERROR(L10)______________________________________
____________________________________________________
____________________________________________________
Note that the insert and delete keys can be used on this prompt which allows the command parameters to be "pushed" off one line and onto the next line. This is very useful when a lot of changes must be made in the middle of the command.
Resulting display 3 - Re-display of RDML program after changes:
No Act Lbl Command Parameters
1 __ L10 REQUEST FIELDS(#ORDER)_________________________
2 __ ___ INSERT FIELDS(#ORDER #PRODNO #QUANTITY #DATDUE
3 __ ___ _________ #TOTAL #ADD1 #ADD2 #ADD3 #ADD4 #TOTLIN)
4 __ ___ __________ TO_FILE(ORDERS)________________________
4 __ ___ __________ VAL_ERROR(L10)_________________________
5 __ ___ GOTO L10____________________________________
Note: If command key F12 is taken from the prompt screen following any changes to the command, all changes will be lost and the command will revert to its original value.
Example 3. Field List Prompting
Starting display:
No Act Lbl Command Parameters
1 F ___ GROUP_BY #ORDERDATA________________________
2 __ ___ INSERT FIELDS(#ORDERDATA) TO_FILE(ORDERS)
3 __ ___ GOTO L10_______________________________
Resulting display 1 - Field list prompt of a GROUP_BY command:
Group fields into a named list (GROUP_BY) prompt
1 GROUP_BY #ORDERDATA_____________________________
__________________________________________________
__________________________________________________ +
Full/partial name of fields to be chosen from data dictionary: _____
Full/partial name of files from which fields are to be chosen: ORDERS
Resulting display 2 - Selection of fields to add to GROUP_BY command:
Group fields into a named list (GROUP_BY) prompt
1 GROUP_BY #ORDERDATA______________________________
___________________________________________________
___________________________________________________ +
Full/partial name of fields to be chosen from data dictionary:
Full/partial name of files from which fields are to be chosen: ORDERS
Sel_Field___Description__________________TypeLenDec_Selected from__
X ORDER Order number A 6 ORDERS.QGPL
X PRODNO Product number A 7 ORDERS.QGPL
X QUANTITY Quantity ordered P 9 2 ORDERS.QGPL +
Resulting display 3: Field list prompt of a GROUP_BY command
Group fields into a named list (GROUP_BY) prompt
1 GROUP_BY NAME(#ORDERDATA) FIELDS((#ORDER)(#PRODNO)
(#QUANTITY))_____________________________
_________________________________________ +
Full/partial name of fields to be chosen from data dictionary:
Full/partial name of files from which fields are to be chosen: ORDERS
Sel Field Description TypeLenDec Selected from
ORDER Order number A 6 ORDERS.QGPL
PRODNO Product number A 7 ORDERS.QGPL
QUANTITY Quantity ordered P 9 2 ORDERS.QGPL +
Resulting display 4 - Re-display of RDML program after changes:
No Act Lbl Command Parameters
1 __ ___ GROUP_BY NAME(#ORDERDATA) FIELDS((#ORDER)_________
3 __ ___ __________ (#PRODNO) (#QUANTITY))___________________
2 __ ___ INSERT FIELDS(#ORDERDATA) TO_FILE(ORDERS)_______
3 __ ___ GOTO L10______________________________________
Note - If command key F12 is taken from the prompt screen following any changes to the command, all changes will be lost and the command will revert back to its original value.
Example 4. Application Template Prompting
Starting display:
No Act Lbl Command Parameters
1 __ ___ ********** Display list of products (page_at
2 __ ___ ********** a time) and_allow the user to____
2 __ ___ ********** select the one required__________
3 ET ___ BBPAT _________________________________
Note the use of the name BBPAT in the command column. The programmer is indicating that an Application Template called BBPAT is to be invoked by this request. The name can be omitted to cause a list of all templates to be displayed, or specified generically to cause a partial list of templates to be displayed.
Resulting display 1: Code generated by the template is inserted
Note that any "question & answer" interaction that the Application Template used is omitted from this example. Any such interaction would take place in a pop-up window overlaying the lower half of the RDML edit screen, just as it does when an application template is invoked when creating a new function.
1 __ ___ ********** Display list of products (page at____
2 __ ___ ********** at a time) andallow the user to______
4 __ ___ ********** select the one required______________
5 __ ___ __________ _____________________________________
6 __ ___ CHANGE FIELD(#IO$KEY) TO(UP)________________
7 __ ___ SELECT FIELDS(#PRODLIST) FROM_FILE(PRODMST)_
8 __ ___ EXECUTE SUBROUTINE(PROD$DISP)________________
9 __ ___ ADD_ENTRY TO_LIST(#PRODLIST) WITH_MODE(*DISPLAY)
etc, etc...
Example 5. Copy Function Prompting
Starting display:
No Act Lbl Command Parameters
1 __ ___ DEFINE FIELD(#ORDNO) TYPE(*CHAR) LENGTH(6)_
2 __ ___ DEFINE FIELD(#PRODNO) TYPE(*CHAR) LENGTH(7)
3 EF ___ DEFINE FIELD(#QTY) TYPE(*DEC) LENGTH(9)____
Resulting display 1: Copy selection screen:
|
The
screen is requesting that you indicate whether to copy an entire or a part of a function.If you specify YES for the
input field and valid process and function names, it will copy the entire RDML code from the specified function. If you wish to copy a part of another function or to display another function specify NO for the 'Copy all RDML code' input field and valid process and function names.The process and function names nominated for copy or display are checked for existence and access rights. If any error occurs the screen will be re-presented with an error message.
IF 'YES' is entered for the 'Copy all RDML code' input field the following screen will appear after copying the entire RDML code.
Resulting display 2 - Entire code copied from another function is inserted:
No Act Lbl Command Parameters__________________________
1 __ ___ DEFINE FIELD(#ORDNO) TYPE(*CHAR) LENGTH(6)_
2 __ ___ DEFINE FIELD(#PRODNO) TYPE(*CHAR) LENGTH(7)
3 __ ___ DEFINE FIELD(#QTY) TYPE(*DEC) LENGTH(9)____
4 __ ___ BEGINLOOP ____________________________________
5 __ ___ REQUEST FIELDS(#ORDNO)______________________
6 __ ___ INSERT FIELDS(#ORDNO #PRODNO #QTY)_________
7 __ ___ ___________ TO_FILE(ORDERS)_____________________
etc, etc...
If 'NO' is entered for the 'Copy all RDML code' input field, the indicated copy range will have to be entered manually by the user.
Resulting display 3 - Display/Copy RDML commands:
|
This C or to copy a range indicate CC as a pair. Only C or CC are allowed for the action code.
screen will show the RDML commands of the function you requested to copy or display. If you need to copy one single line, enter action codeF6 and F7 can be used to position the display at the start or end of the RDML function.
A Find string with F16 can be used to scan and position the display.
Resulting display 4 - Part of the RDML code is copied and inserted:
No Act Lbl Command Parameters
1 __ ___ DEFINE FIELD(#ORDNO) TYPE(*CHAR) LENGTH(6)________
2 __ ___ DEFINE FIELD(#PRODNO) TYPE(*CHAR) LENGTH(7)_______
3 __ ___ DEFINE FIELD(#QTY) TYPE(*DEC) LENGTH(9)___________
4 __ ___ REQUEST FIELDS(#ORDNO #PRODNO #QTY)________________
5 __ ___ INSERT FIELDS(#ORDNO #PRODNO #QTY) TO_FILE(ORDERS)
6 __ ___ CHANGE #ORDNO *BLANKS_____________________________
7 __ ___ CHANGE #PRODNO *BLANKS____________________________