1 &ANALYZE-SUSPEND _VERSION-NUMBER UIB_v8r12
3 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _DEFINITIONS Method-Library
4 /*--------------------------------------------------------------------------
15 ------------------------------------------------------------------------*/
17 /* *************************** Definitions
************************** */
19 /* _UIB-CODE-BLOCK-END
*/
23 &ANALYZE-SUSPEND _UIB-PREPROCESSOR-BLOCK
25 /* ******************** Preprocessor Definitions
******************** */
29 /* _UIB-PREPROCESSOR-BLOCK-END
*/
33 /* ************************ Function Prototypes
********************** */
35 &IF DEFINED(EXCLUDE-convert-cha) = 0 &THEN
37 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION-FORWARD convert-cha Method-Library
38 FUNCTION convert-cha
RETURNS CHAR
39 ( INPUT in-text
AS CHAR ) FORWARD.
41 /* _UIB-CODE-BLOCK-END
*/
46 &IF DEFINED(EXCLUDE-convert-dat) = 0 &THEN
48 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION-FORWARD convert-dat Method-Library
49 FUNCTION convert-dat
RETURNS CHAR
50 ( INPUT in-date
AS DATE ) FORWARD.
52 /* _UIB-CODE-BLOCK-END
*/
57 &IF DEFINED(EXCLUDE-convert-dec) = 0 &THEN
59 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION-FORWARD convert-dec Method-Library
60 FUNCTION convert-dec
RETURNS CHAR
61 ( INPUT in-dec
AS DEC ) FORWARD.
63 /* _UIB-CODE-BLOCK-END
*/
68 &IF DEFINED(EXCLUDE-convert-int) = 0 &THEN
70 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION-FORWARD convert-int Method-Library
71 FUNCTION convert-int
RETURNS CHAR
72 ( INPUT in-int
AS INT ) FORWARD.
74 /* _UIB-CODE-BLOCK-END
*/
79 &IF DEFINED(EXCLUDE-convert-log) = 0 &THEN
81 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION-FORWARD convert-log Method-Library
82 FUNCTION convert-log
RETURNS CHARACTER
83 ( INPUT in-log
AS LOGICAL ) FORWARD.
85 /* _UIB-CODE-BLOCK-END
*/
90 &IF DEFINED(EXCLUDE-convert-raw) = 0 &THEN
92 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION-FORWARD convert-raw Method-Library
93 FUNCTION convert-raw
RETURNS CHAR
94 ( INPUT in-text
AS RAW ) FORWARD.
96 /* _UIB-CODE-BLOCK-END
*/
101 &IF DEFINED(EXCLUDE-convert-rec) = 0 &THEN
103 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION-FORWARD convert-rec Method-Library
104 FUNCTION convert-rec
RETURNS CHAR
105 ( INPUT in-int
AS RECID ) FORWARD.
107 /* _UIB-CODE-BLOCK-END
*/
112 &IF DEFINED(EXCLUDE-convert-row) = 0 &THEN
114 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION-FORWARD convert-row Method-Library
115 FUNCTION convert-row
RETURNS CHAR
116 ( INPUT in-int
AS ROWID ) FORWARD.
118 /* _UIB-CODE-BLOCK-END
*/
124 /* *********************** Procedure Settings
************************ */
126 &ANALYZE-SUSPEND _PROCEDURE-SETTINGS
127 /* Settings for
THIS-PROCEDURE
131 Add Fields to
: Neither
132 Other Settings
: INCLUDE-ONLY
134 &ANALYZE-RESUME _END-PROCEDURE-SETTINGS
136 /* ************************* Create Window
************************** */
138 &ANALYZE-SUSPEND _CREATE-WINDOW
139 /* DESIGN Window definition
(used by the UIB
)
140 CREATE WINDOW Method-Library
ASSIGN
143 /* END WINDOW DEFINITION
*/
149 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _INCLUDED-LIB Method-Library
150 /* ************************* Included-Libraries
*********************** */
152 /* _UIB-CODE-BLOCK-END
*/
157 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _MAIN-BLOCK Method-Library
160 /* *************************** Main Block
*************************** */
164 /* _UIB-CODE-BLOCK-END
*/
168 /* ************************ Function Implementations
***************** */
170 &IF DEFINED(EXCLUDE-convert-cha) = 0 &THEN
172 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION convert-cha Method-Library
173 FUNCTION convert-cha
RETURNS CHAR
174 ( INPUT in-text
AS CHAR ) :
175 /*------------------------------------------------------------------------------
176 Purpose
: Convert a character string to a string for
SQL import
177 ------------------------------------------------------------------------------*/
178 IF in-text
= ?
THEN RETURN "NULL".
180 in-text
= REPLACE( in-text
, "'", "''").
181 in-text
= REPLACE( in-text
, "\", "\\").
182 RETURN "'" + in-text
+ "'".
186 /* _UIB-CODE-BLOCK-END
*/
191 &IF DEFINED(EXCLUDE-convert-dat) = 0 &THEN
193 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION convert-dat Method-Library
194 FUNCTION convert-dat
RETURNS CHAR
195 ( INPUT in-date
AS DATE ) :
196 /*------------------------------------------------------------------------------
197 Purpose
: Convert a date to a string generically for
SQL import
198 ------------------------------------------------------------------------------*/
199 IF in-date
= ?
THEN RETURN "NULL".
201 RETURN "'" + STRING(in-date
, "99-99-9999") + "'".
205 /* _UIB-CODE-BLOCK-END
*/
210 &IF DEFINED(EXCLUDE-convert-dec) = 0 &THEN
212 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION convert-dec Method-Library
213 FUNCTION convert-dec
RETURNS CHAR
214 ( INPUT in-dec
AS DEC ) :
215 /*------------------------------------------------------------------------------
216 Purpose
: Convert a decimal to a string generically for
SQL import
217 ------------------------------------------------------------------------------*/
218 IF in-dec
= ?
THEN RETURN "NULL".
220 RETURN RIGHT-TRIM( RIGHT-TRIM( TRIM(STRING(in-dec
, "->>>>>>>>>>>>>>>9.99999999999")), "0"), ".").
224 /* _UIB-CODE-BLOCK-END
*/
229 &IF DEFINED(EXCLUDE-convert-int) = 0 &THEN
231 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION convert-int Method-Library
232 FUNCTION convert-int
RETURNS CHAR
233 ( INPUT in-int
AS INT ) :
234 /*------------------------------------------------------------------------------
235 Purpose
: Convert an Int to a string generically for
SQL import
236 ------------------------------------------------------------------------------*/
237 IF in-int
= ?
THEN RETURN "NULL".
239 RETURN TRIM(STRING(in-int
, "->>>>>>>>>>9")).
243 /* _UIB-CODE-BLOCK-END
*/
248 &IF DEFINED(EXCLUDE-convert-log) = 0 &THEN
250 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION convert-log Method-Library
251 FUNCTION convert-log
RETURNS CHARACTER
252 ( INPUT in-log
AS LOGICAL ) :
253 /*------------------------------------------------------------------------------
256 ------------------------------------------------------------------------------*/
257 IF in-log
= ?
THEN RETURN "NULL".
259 RETURN STRING( in-log
, "TRUE/FALSE").
263 /* _UIB-CODE-BLOCK-END
*/
268 &IF DEFINED(EXCLUDE-convert-raw) = 0 &THEN
270 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION convert-raw Method-Library
271 FUNCTION convert-raw
RETURNS CHAR
272 ( INPUT in-text
AS RAW ) :
273 /*------------------------------------------------------------------------------
274 Purpose
: Convert a character string to a string for
SQL import
275 ------------------------------------------------------------------------------*/
276 DEF VAR out-str
AS CHAR NO-UNDO.
278 IF in-text
= ?
THEN RETURN "NULL".
280 out-str
= REPLACE( STRING(in-text
), "'", "''").
281 RETURN "'" + out-str
+ "'".
285 /* _UIB-CODE-BLOCK-END
*/
290 &IF DEFINED(EXCLUDE-convert-rec) = 0 &THEN
292 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION convert-rec Method-Library
293 FUNCTION convert-rec
RETURNS CHAR
294 ( INPUT in-int
AS RECID ) :
295 /*------------------------------------------------------------------------------
296 Purpose
: Convert an Int to a string generically for
SQL import
297 ------------------------------------------------------------------------------*/
299 IF in-int
= ?
THEN RETURN "NULL".
300 RETURN TRIM(STRING(in-int
)).
304 /* _UIB-CODE-BLOCK-END
*/
309 &IF DEFINED(EXCLUDE-convert-row) = 0 &THEN
311 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION convert-row Method-Library
312 FUNCTION convert-row
RETURNS CHAR
313 ( INPUT in-int
AS ROWID ) :
314 /*------------------------------------------------------------------------------
315 Purpose
: Convert an Int to a string generically for
SQL import
316 ------------------------------------------------------------------------------*/
318 IF in-int
= ?
THEN RETURN "NULL".
319 RETURN TRIM(STRING(in-int
)).
323 /* _UIB-CODE-BLOCK-END
*/