1 &ANALYZE-SUSPEND _VERSION-NUMBER UIB_v8r12
3 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _DEFINITIONS Procedure
4 /*--------------------------------------------------------------------------
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
, "\", "/" ).
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
*/
39 &ANALYZE-SUSPEND _UIB-PREPROCESSOR-BLOCK
41 /* ******************** Preprocessor Definitions
******************** */
43 &Scoped-define PROCEDURE-TYPE Procedure
47 /* _UIB-PREPROCESSOR-BLOCK-END
*/
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
*/
61 /* *********************** Procedure Settings
************************ */
63 &ANALYZE-SUSPEND _PROCEDURE-SETTINGS
64 /* Settings for
THIS-PROCEDURE
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
80 /* END WINDOW DEFINITION
*/
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
*/
99 /* ********************** Internal Procedures
*********************** */
101 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE convert-link-nodes Procedure
102 PROCEDURE convert-link-nodes
:
103 /*------------------------------------------------------------------------------
107 ------------------------------------------------------------------------------*/
109 DEF VAR file-path
AS CHAR NO-UNDO.
110 DEF VAR runfile-path
AS CHAR NO-UNDO.
113 file-path
= "". runfile-path
= "".
114 IF LinkNode.RunFile
= "" THEN DO:
115 file-path
= program-path
( LinkNode.File
).
118 runfile-path
= program-path
( LinkNode.RunFile
).
121 IF file-path
<> "" THEN ASSIGN LinkNode.File
= file-path.
122 IF runfile-path
<> "" THEN ASSIGN LinkNode.RunFile
= runfile-path.
128 /* _UIB-CODE-BLOCK-END
*/
132 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE convert-program-links Procedure
133 PROCEDURE convert-program-links
:
134 /*------------------------------------------------------------------------------
138 ------------------------------------------------------------------------------*/
140 DEF VAR viewer-path
AS CHAR NO-UNDO.
142 FOR EACH ProgramLink
:
144 IF ProgramLink.Viewer
<> "" THEN
145 viewer-path
= program-path
( ProgramLink.Viewer
).
147 IF viewer-path
<> "" THEN ASSIGN ProgramLink.Viewer
= viewer-path.
153 /* _UIB-CODE-BLOCK-END
*/
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 /*------------------------------------------------------------------------------
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
= "":
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".
180 IF SEARCH( pseudo-name
) <> ?
THEN out_name
= pseudo-name.
182 RETURN out_name.
/* Function return value.
*/
186 /* _UIB-CODE-BLOCK-END
*/