Kbase P98330: How to use XREF Option during compile?
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  29/06/2005 |
|
Status: Verified
GOAL:
How to use XREF Option during compile?
GOAL:
How to use the COMPILE XREF?
FIX:
XREF Option during compilation writes cross-reference information between procedures and Progress objects to the file xref file or VALUE ( expression ). If expression returns the unknown value (?), then Progress ignores the XREF option.
NOTE: You cannot use the XREF and XCODE options together. That is, you cannot create a cross-reference listing from code that is encrypted.
Cross-referenced objects include procedure and include files, user-defined functions, tables, fields, variables, frames, and character strings. XREF generates one unformatted, blank-separated line in xref file for each object reference. Each line has the following format.
The procedure-name is the name of the procedure you compile with the COMPILE XREF statement. The file-name is the name of the file with the referenced code. The line-number is the line number of the statement in file-name that contains the object reference. The reference-type is the type of reference in the code (such as ACCESS or UPDATE), and the object-identifier is the Progress object being referenced.
NOTE: If file-name is an include-file, procedure-name is the file that includes the include-file.
Reference Type Object Identifier
COMPILE procedure
STRING char-string max-length justification translatable [FORMAT ]
RUN procedure-name | value(exp)
INCLUDE include-file-name
CREATE [database.]table [ WORKTABLE]
DELETE [database.]table [WORKTABLE]
SORT-ACCESS  .; {[database.]table field [WORKTABLE | TEMPTABLE]}
ACCESS {[database.]table field [WORKTABLE]} | {SHARED variable}
REFERENCE {[database.]table field [WORKTABLE]} | {SHARED variable}
UPDATE {[database.]table field [WORKTABLE]} | {SHARED variable}
SEARCH [database.]table
{index | RECID | WORKTABLE | TEMPTABLE}
[WHOLE-INDEX]
NEW-SHR-VARIABLE new-shared-variable
GLOBAL-VARIABLE global-variable
SHR-FRAME shared-frame
NEW-SHR-FRAME new-shared-frame
SHR-WORK.TABLE shared-worktable [LIKE [database.]table]
NEW-SHR-WORKTABLE new-shared-worktable [LIKE [database.]table]
FUNCTION function-name,return-type,[parameter1
[,parameter2] ...]
EXTERN function-name,return-type,[parameter1
[,parameter2] ...]
PROCEDURE procedure-name,,[parameter1[,parameter2] ...]
DLL-ENTRY procedure-name,,[parameter1[,parameter2] ...]
PUBLISH event-name|(exp)
SUBSCRIBE event-name|(exp)
UNSUBSCRIBE event-name|(exp)|ALL
CPINTERNAL &.nbsp; name-of-the-code-page-that-Progress-uses-in-memory
CPSTREAM name-of-the-code-page-that-Progress-uses-for-stream-I/O
SORT-BY-EXP { FOR EACH | OPEN QUERY } table BY expression
WHOLE-INDEX: Means that the selection criteria specified to search the table does not offer opportunities to use indexes that allow optimized key references (bracketed high and low values). Instead, Progress must search the entire table using available indexes (often only the primary index) to satisfy the query, hence a WHOLE-INDEX search. Thus, depending on the query, you might be able to optimize the search by adding indexes. See also NOTES.
If you specify the APPEND option, the cross-reference information is appended to an existing file. The first line of cross-reference information for a procedure contains the object identifier for the COMPILE reference type. This allows you to easily find where the information for each compilation begins. If you specify a logical-expression, its value determines whether the APPEND option is activated. If the logical-expression is evaluated to the unknown value (?), a run-time error occurs
STRING-XREF { sxreffile | VALUE ( expression ) }
[ APPEND [ = logical-expression ] ]
Writes cross-reference string information between procedures and Progress objects to the file sxreffile or VALUE ( expression ). If expression evaluates to the unknown value (?), Progress ignores the STRING-XREF option.
String Xref Version x.y source-file code-page:
The x.y is a major.minor version number, where a major version change implies a formatting change that will not be backward compatible with older versions of TranManII. The source-file is the name of the file from which the strings are extracted. The code-page is the code page with which the file was written.
The line for each string appears in the following format.
line-number object-name string max-length string-justification statement-type detail-info
The line-number is the same as line-number in the standard XREF file. The object-name is the name of the object with which the string is associated. The max-length and string-justification come from the string attribute (either explicit or implicit) and reflect the attributes applied to the string as it is entered into the text segment.
The statement-type describes the type of statement in which the string appears. Only one statement type appears in a given string's output line.
The following values are possible:
Statement Type Values
ASSIGN DEF-SUB-MENU INSERT . PUT-SCREEN
CASE DISPLAY MESSAGE REPEAT
CREATE DO OPEN-QUERY RUN
DEF-BROWSE ENABLE OTHER SET
DEF-BUTTON EXPORT PAUSE STATUS
DEF-FRAME FOR PROMPT-FOR UPDATE
DEF-IMAGE FORM PUT VIEW-AS
DEF-MENU IF
NOTE: Any statement type that is not included in the preceding list will appear as OTHER.
The detail-info is one or more detail tags that specify more specifically where the string appears in the statement.
The following values are possible:
Detail Tags
ASSIGN FORMAT MESSAGE &.nbsp; TITLE
COL-LABEL IMAGE-FILE NON-ALPHA VALUE
COMBO-BOX-ITEM INPUT PROMSGS WHEN
CUR-LANG INPUT-PARAM PROPATH WHERE
DEFAULT LABEL SEL-LIST-ITEM WHILE
EXPR LIST-ITEM TERMCAP
NOTE: The NON-ALPHA tag indicates that a string consists entirely of blanks or digits.
The FORMAT tag is followed by one of the following tags: CHAR, NUMERIC (includes decimal and integer), DATE, or BOOL. These tags indicate the type of format. When a string can appear in only one place in a statement, no detail tag appears.
Valid Combinations of Statement Types and Detail Tags:
Statement Type Detail Tags
ASSIGN CUR-LANG, PROMSGS, PROPATH, TERMCAP
CASE WHEN
CREATE N/A
DEF-BROWSE FORMAT, COL-LABEL
DE-FBUTTON IMAGE-FILE, LABEL
DEF-FRAME FORMAT, COL-LABEL, LABEL
DEF-IMAGE IMAGE-FILE
DEF-MENU TITLE, LABEL
DEF-SUB-MENU LABEL
DISPLAY FORMAT, LABEL, COL-LABEL, WHEN, TITLE
DO WHILE, WHERE, TITLE
ENABLE LABEL, COL-LABEL, WHEN, TITLE
EXPORT &.nbsp;FORMAT
FOR WHILE, WHERE, TITLE
FORM FORMAT
IF N/A
INSERT TITLE
MESSAGE TITLE, FORMAT
PAUSE MESSAGE
PROMPT-FOR WHEN, TITLE, FORMAT, LABEL, COL-LABEL
PUT N/A
PUT-SCREEN N/A
REPEAT WHILE, TITLE, WHERE
RUN INPUT-PARAM
SET WHEN, ASSIGN, FORMAT, LABEL, COL-LABEL, TITLE
STATUS DEFAULT, INPUT
UPDATE WHEN, ASSIGN, FORMAT, LABEL, COL-LABEL, TITLE
VIEW-AS SEL-LIST-ITEM, COMBO-BOX-ITEM
Example on how to use the COMPILE XREF:
COMPILE r-incl.p SAVE XREF r-incl.xrf.
r-incl.xrf
r-incl.p r-incl.p 1 COMPILE r-incl.p
r-incl.p r-incl.p 3 STRING "Customer" 8 NONE UNTRANSLATABLE
r-incl.p r-incl.p 3 SEARCH sports.Customer Cust-Num
r-incl.p r-incl.p 4 INCLUDE r-fcust.i
r-incl.p r-fcust.i 3 ACCESS sports.Customer Cust-Num
r-incl.p r-fcust.i 3 ACCESS sports.Customer Name
r-incl.p r-fcust.i 3 ACCESS sports.Customer Phone
r-incl.p r-fcust.i 3 STRING ">>>>9" 5 NONE TRANSLATABLE FORMAT
r-incl.p r-fcust.i 3 STRING "x(20)" 5 NONE TRANSLATABLE FORMAT
r-incl.p r-fcust.i 3 STRING "999-999-9999" 12 NONE TRANSLATABLE FORMAT
r-incl.p r-incl.p 5 INCLUDE r-dcust.i
r-incl.p r-dcust.i 3 ACCESS sports.Customer Cust-Num
r-incl.p r-dcust.i 3 ACCESS sports.Customer Name
r-incl.p r-dcust.i 3 ACCESS sports.Customer Phone
r-incl.p r-incl.p 6 STRING "Cust-Num" 8 LEFT TRANSLATABLE
r-incl.p r-incl.p 6 STRING "Customer Name" 13 LEFT TRANSLATABLE
r-incl.p r-incl.p 6 STRING "Phone" 5 LEFT TRANSLATABLE
r-incl.p r-incl.p 6 STRING "-------- ---------------------- --------------" 46 LEFT TRANSLATABLE
r-incl.p r-incl.p 6 STRING "Cust-Num" 8 LEFT TRANSLATABLE
Each line in the xref file specifies the procedure, line number, access type, and access information. The first line in the xref file contains the COMPILE access type directive and the name of the procedure exactly as it appears in the COMPILE statement. See Table 14 for a list of the values that follow a particular access type (for example, table and index after SEARCH)..