Added capital works blank section. Synced calling screen.
[capital-apms-progress.git] / process / one-off / convlink.p
bloba6d384085532ef77927ceb9afa36f0fb760230d8
1 &ANALYZE-SUSPEND _VERSION-NUMBER UIB_v8r12
2 &ANALYZE-RESUME
3 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _DEFINITIONS Procedure
4 /*--------------------------------------------------------------------------
5 File :
6 Purpose :
8 Syntax :
10 Description :
12 Author(s) :
13 Created :
14 Notes :
15 ------------------------------------------------------------------------*/
16 /* This .W file was created with the Progress UIB. */
17 /*----------------------------------------------------------------------*/
19 /* *************************** Definitions ************************** */
21 DEF VAR path-list AS CHAR NO-UNDO.
22 DEF VAR i AS INT NO-UNDO.
23 DEF VAR path-entry AS CHAR NO-UNDO.
25 DO i = 1 TO NUM-ENTRIES( PROPATH ):
26 path-entry = ENTRY( i, PROPATH ).
27 IF path-entry <> "." AND INDEX( path-entry, ":" ) = 0 THEN DO:
28 path-list = path-list + IF path-list = "" THEN "" ELSE ",".
29 path-list = path-list + REPLACE( path-entry, "\", "/" ).
30 END.
31 END.
32 path-list = REPLACE( path-list, "./", "" ). /* Remove any redundant base references */
33 path-list = LC( path-list ). /* Just to look nice */
35 /* _UIB-CODE-BLOCK-END */
36 &ANALYZE-RESUME
39 &ANALYZE-SUSPEND _UIB-PREPROCESSOR-BLOCK
41 /* ******************** Preprocessor Definitions ******************** */
43 &Scoped-define PROCEDURE-TYPE Procedure
47 /* _UIB-PREPROCESSOR-BLOCK-END */
48 &ANALYZE-RESUME
51 /* ************************ Function Prototypes ********************** */
53 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION-FORWARD program-path Procedure
54 FUNCTION program-path RETURNS CHARACTER
55 ( INPUT pseudo-name AS CHAR ) FORWARD.
57 /* _UIB-CODE-BLOCK-END */
58 &ANALYZE-RESUME
61 /* *********************** Procedure Settings ************************ */
63 &ANALYZE-SUSPEND _PROCEDURE-SETTINGS
64 /* Settings for THIS-PROCEDURE
65 Type: Procedure
66 Allow:
67 Frames: 0
68 Add Fields to: Neither
69 Other Settings: CODE-ONLY COMPILE
71 &ANALYZE-RESUME _END-PROCEDURE-SETTINGS
73 /* ************************* Create Window ************************** */
75 &ANALYZE-SUSPEND _CREATE-WINDOW
76 /* DESIGN Window definition (used by the UIB)
77 CREATE WINDOW Procedure ASSIGN
78 HEIGHT = 2
79 WIDTH = 40.
80 /* END WINDOW DEFINITION */
82 &ANALYZE-RESUME
87 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _MAIN-BLOCK Procedure
90 /* *************************** Main Block *************************** */
92 RUN convert-link-nodes.
93 RUN convert-program-links.
95 /* _UIB-CODE-BLOCK-END */
96 &ANALYZE-RESUME
99 /* ********************** Internal Procedures *********************** */
101 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE convert-link-nodes Procedure
102 PROCEDURE convert-link-nodes :
103 /*------------------------------------------------------------------------------
104 Purpose:
105 Parameters: <none>
106 Notes:
107 ------------------------------------------------------------------------------*/
109 DEF VAR file-path AS CHAR NO-UNDO.
110 DEF VAR runfile-path AS CHAR NO-UNDO.
112 FOR EACH LinkNode:
113 file-path = "". runfile-path = "".
114 IF LinkNode.RunFile = "" THEN DO:
115 file-path = program-path( LinkNode.File ).
116 END.
117 ELSE DO:
118 runfile-path = program-path( LinkNode.RunFile ).
119 END.
121 IF file-path <> "" THEN ASSIGN LinkNode.File = file-path.
122 IF runfile-path <> "" THEN ASSIGN LinkNode.RunFile = runfile-path.
124 END.
126 END PROCEDURE.
128 /* _UIB-CODE-BLOCK-END */
129 &ANALYZE-RESUME
132 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE convert-program-links Procedure
133 PROCEDURE convert-program-links :
134 /*------------------------------------------------------------------------------
135 Purpose:
136 Parameters: <none>
137 Notes:
138 ------------------------------------------------------------------------------*/
140 DEF VAR viewer-path AS CHAR NO-UNDO.
142 FOR EACH ProgramLink:
143 viewer-path = "".
144 IF ProgramLink.Viewer <> "" THEN
145 viewer-path = program-path( ProgramLink.Viewer ).
147 IF viewer-path <> "" THEN ASSIGN ProgramLink.Viewer = viewer-path.
149 END.
151 END PROCEDURE.
153 /* _UIB-CODE-BLOCK-END */
154 &ANALYZE-RESUME
157 /* ************************ Function Implementations ***************** */
159 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION program-path Procedure
160 FUNCTION program-path RETURNS CHARACTER
161 ( INPUT pseudo-name AS CHAR ) :
162 /*------------------------------------------------------------------------------
163 Purpose:
164 Notes:
165 ------------------------------------------------------------------------------*/
167 /* Scan for the program through the restructured path list */
168 DEF VAR out_name AS CHAR NO-UNDO.
169 DEF VAR i AS INT NO-UNDO.
171 DO WHILE i < NUM-ENTRIES( path-list ) AND out_name = "":
172 i = i + 1.
173 IF SEARCH( ENTRY( i, path-list ) + "/" + pseudo-name ) <> ? THEN
174 out_name = ENTRY( i, path-list ) + "/" + pseudo-name.
176 ELSE IF SEARCH( ENTRY( i, path-list ) + "/" + pseudo-name + ".w" ) <> ? THEN
177 out_name = ENTRY( i, path-list ) + "/" + pseudo-name + ".w".
178 END.
180 IF SEARCH( pseudo-name ) <> ? THEN out_name = pseudo-name.
182 RETURN out_name. /* Function return value. */
184 END FUNCTION.
186 /* _UIB-CODE-BLOCK-END */
187 &ANALYZE-RESUME