Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved


Chapter 3 Tools : GEN_TED

GEN_TED
Presents a screen where text can be entered and edited under the control of the text editor. (C)
Invocation
CALL GEN_TED(tablespec, screenname, screentablename)
 
The name of the table (including its parameters, if any) that contains the text to appear and edited. This could be a predefined text table or another table that contains the same field names and syntaxes as @TEXT.
One screen table must be defined to meet the requirements of the screentablename argument given below.
There must be a table instance of PFKEYS(screen). It can be copied from PFKEYS(@GEN_TED) and occurrences can be added and deleted as required.
The name of the screen table that is manipulated by the text editor. It must contain the fields listed below. If an application does not specifically require some of the fields, they can be defined as SHOW = N, PROT = Y or be given a value of ROW = 0, COL = 0. This removes them from the physical screen. Even though the fields do not appear, other fields cannot be defined to the same position.
Usage Notes
Requirements for Screen Table
The fields listed here must be in the screen table, in the titles area:
This field must be long enough to contain tablespec. It must be TYP = S, SYN = C.
This field is used to accept the line command I, if required. You use this line command to insert data at the top of the text. It should be positioned directly above the field CMD. It must be TYP = S, SYN = C, LEN = 1. If you use the FILL = _ (underscore), this field looks like the other line command field, CMD.
The scrollable part of the screen table must also contain a line with these fields:
This is used for line commands. It must be TYP = S, SYN = V, LEN = 1. Set PROT = Y to prevent users from typing in this field before the line is available for text input. GEN_TED unprotects this field as needed.
This field holds the line of text. It must be TYP = S, SYN = V. Set PROT = Y to prevent users from typing in this field before the line is available for text input. GEN_TED unprotects this field as needed.
This holds the number for each line. It can be defined as SHOW = N, PROT = Y. This removes it from the physical screen. Even though the field does not appear, another field cannot be defined to the same position. It must be TYP = C, SYN = B, LEN = 4.
Requirements for Text Table
A text table can be parameterized and it must contain these two fields:
 
Other Requirements
The exception handler TED_ERROR must be provided. In the case of error, GEN_TED raises the TED_ERROR exception and stores the message in the MSG variable.
The occurrence SAVE in the table PFKEYS(screen) must call a rule that ends by calling GEN_EDSAVER. GEN_EDSAVER saves the information entered to the text screen table.
Example
The following example presents a screen that accepts text editing. The example is composed of:
Definition of PROJ_WEEK_STAT_1 Screen Table
The fields of the screen table PROJ_WEEK_STAT_1 are defined as follows:

 
Table: PROJ_WEEK_STAT_1 Unit: USR40
ROW COL Field Name Type Syn Len Dec Just Fill Prot Show Rqd Hi Skip Null
------- ---------- - - --- --- - - - - - - - -
1 24 TABLENAME S C 40 0 L Y N N N Y Y
1 67 COMMAND S C 1 0 L Y N N N Y Y
2 3 CMND S C 1 0 L N Y N N Y Y
3 3 CMD S C 1 0 L Y Y N N Y Y
3 5 LINE S V 68 0 L Y Y N N Y Y
3 74 NUMBER C B 5 0 L Y N N N Y Y

 
Rule Using GEN_TED
The example rule uses the screen WEEKLY_STATUS_G and is as follows:

 
GEN_TED_1(PROJECT);
_ LOCAL SCREEN, MSG;
_
---------------------------------------------------------------------
--------------------------------------------------------+------------
_ |
_ SCREEN = 'WEEKLY_STATUS_G'; | 1
_ PFKEY_SPECS.PCKEYS = PFKEY_MSG(SCREEN); | 1
_ INSERT PFKEY_SPECS(SCREEN); | 1
_ CALL GEN_TED('@TEXT(STATUS, ' || PROJECT ||')', | 2
_ SCREEN, 'PROJ_WEEK_STAT_1'); |
---------------------------------------------------------------------
_ ON TED_ERROR :
_ CALL ENDMSG(MSG);

 
Output for the GEN_TED_1(PROJECT) Rule
After the rule executes, the following screen appears:

 
Weekly Status Report Date:
Project: Title:
Status:
For the week of:
Project Description
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
_
_
PFKEYS: 12=QUIT 22=DELETE 3=SAVE 5=SCRIPT 9=REPEAT CMND

 

Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved