1 &ANALYZE-SUSPEND _VERSION-NUMBER UIB_v8r12 GUI
6 &Scoped-define WINDOW-NAME CURRENT-WINDOW
7 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _DEFINITIONS B-table-Win
8 /*------------------------------------------------------------------------
9 ------------------------------------------------------------------------*/
13 /* *************************** Definitions
************************** */
15 {inc
/topic
/tpprojct.i
}
17 DEF VAR filter-value
AS CHAR NO-UNDO INITIAL "".
18 DEF VAR show-completed
AS LOGICAL NO-UNDO INITIAL No.
20 DEF VAR d-date-1
AS CHAR NO-UNDO.
21 DEF VAR d-date-2
AS CHAR NO-UNDO.
22 DEF VAR d-update
AS CHAR NO-UNDO.
24 /* _UIB-CODE-BLOCK-END
*/
28 &ANALYZE-SUSPEND _UIB-PREPROCESSOR-BLOCK
30 /* ******************** Preprocessor Definitions
******************** */
32 &Scoped-define PROCEDURE-TYPE SmartBrowser
34 &Scoped-define ADM-SUPPORTED-LINKS Record-Source,Record-Target,TableIO-Target
36 /* Name of first Frame and
/or Browse and
/or first Query
*/
37 &Scoped-define FRAME-NAME F-Main
38 &Scoped-define BROWSE-NAME br_table
40 /* Internal Tables
(found by Frame
, Query
& Browse Queries) */
41 &Scoped-define INTERNAL-TABLES Project
43 /* Define KEY-PHRASE in case it is used by any query.
*/
44 &Scoped-define KEY-PHRASE TRUE
46 /* Definitions for
BROWSE br_table
*/
47 &Scoped-define FIELDS-IN-QUERY-br_table Project.ProjectCode ~
48 Project.ExpenditureType Project.Name ~
49 STRING( Project.StartDate
, '
99/99/9999'
) @ d-date-1 ~
50 (IF Project.CompleteDate
<> ?
THEN STRING( Project.CompleteDate
, '
99/99/9999'
) ELSE ''
) @ d-date-2
51 &Scoped-define ENABLED-FIELDS-IN-QUERY-br_table
52 &Scoped-define FIELD-PAIRS-IN-QUERY-br_table
53 &Scoped-define OPEN-QUERY-br_table OPEN QUERY br_table FOR EACH Project WHERE ~{&KEY-PHRASE} ~
54 AND (IF show-completed
THEN (Project.CompleteDate
< TODAY) ELSE (Project.CompleteDate
= ?
OR Project.CompleteDate
>= TODAY )) ~
55 AND Project.Name
BEGINS filter-value
NO-LOCK ~
57 &Scoped-define TABLES-IN-QUERY-br_table Project
58 &Scoped-define FIRST-TABLE-IN-QUERY-br_table Project
61 /* Definitions for
FRAME F-Main
*/
63 /* Standard List Definitions
*/
64 &Scoped-Define ENABLED-OBJECTS br_table
66 /* Custom List Definitions
*/
67 /* List-1
,List-2
,List-3
,List-4
,List-5
,List-6
*/
69 /* _UIB-PREPROCESSOR-BLOCK-END
*/
73 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _XFTR "Foreign Keys" B-table-Win _INLINE
74 /* Actions
: ? adm
/support
/keyedit.w ? ? ?
*/
80 ProjectCode||y|TTPL.Project.ProjectCode
81 EntityCode|y|y|ttpl.Project.EntityCode
82 FirstApprover|y|y|ttpl.Project.FirstApprover
83 Proposer|y|y|ttpl.Project.Proposer
84 EntityType|y|y|TTPL.Project.EntityType
87 **************************
88 * Set attributes related to FOREIGN
KEYS
90 RUN set-attribute-list
(
91 'Keys-Accepted
= "EntityCode,FirstApprover,Proposer,EntityType",
92 Keys-Supplied
= "ProjectCode,EntityCode,FirstApprover,Proposer,EntityType"'
:U
).
94 /* Tell the ADM to use the OPEN-QUERY-CASES.
*/
95 &Scoped-define OPEN-QUERY-CASES RUN dispatch ('open-query-cases':U).
96 /**************************
98 /* _UIB-CODE-BLOCK-END
*/
101 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _XFTR "Advanced Query Options" B-table-Win _INLINE
102 /* Actions
: ? adm
/support
/advqedit.w ? ? ?
*/
108 Entity|||ttpl.Project.EntityType|yes
,ttpl.Project.EntityCode|yes
109 Code|y||ttpl.Project.ProjectCode|yes
110 Name|||ttpl.Project.Name|yes
113 ************************
114 * Set attributes related to SORTBY-OPTIONS
*/
115 RUN set-attribute-list
(
116 'SortBy-Options
= "Entity,Code,Name",
117 Sort-Case
= Code'
:U
).
119 /* Tell the ADM to use the OPEN-QUERY-CASES.
*/
120 &Scoped-define OPEN-QUERY-CASES RUN dispatch ('open-query-cases':U).
122 /* This SmartObject is a valid SortBy-Target.
*/
123 &IF '{&user-supported-links}':U ne '':U &THEN
124 &Scoped-define user-supported-links {&user-supported-links},SortBy-Target
126 &Scoped-define user-supported-links SortBy-Target
129 /************************
132 </FILTER-ATTRIBUTES
> */
134 /* _UIB-CODE-BLOCK-END
*/
138 /* *********************** Control Definitions
********************** */
141 /* Definitions of the field level widgets
*/
142 /* Query definitions
*/
144 DEFINE QUERY br_table
FOR
148 /* Browse definitions
*/
149 DEFINE BROWSE br_table
150 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _DISPLAY-FIELDS br_table B-table-Win _STRUCTURED
151 QUERY br_table
NO-LOCK DISPLAY
152 Project.ProjectCode
COLUMN-LABEL "Project"
153 Project.ExpenditureType
COLUMN-LABEL "T" FORMAT "X"
154 Project.Name
FORMAT "X(55)"
155 STRING( Project.StartDate
, '
99/99/9999'
) @ d-date-1
COLUMN-LABEL " Start Date" FORMAT "X(12)"
156 (IF Project.CompleteDate
<> ?
THEN STRING( Project.CompleteDate
, '
99/99/9999'
) ELSE ''
) @ d-date-2
COLUMN-LABEL " End Date" FORMAT "X(12)"
157 /* _UIB-CODE-BLOCK-END
*/
159 WITH NO-ASSIGN SEPARATORS SIZE 69.14 BY 16.95
163 /* ************************ Frame Definitions
*********************** */
166 br_table
AT ROW 1 COL 1
167 WITH 1 DOWN NO-BOX KEEP-TAB-ORDER OVERLAY
168 SIDE-LABELS NO-UNDERLINE THREE-D
169 AT COL 1 ROW 1 SCROLLABLE
170 BGCOLOR 8 FGCOLOR 0 .
173 /* *********************** Procedure Settings
************************ */
175 &ANALYZE-SUSPEND _PROCEDURE-SETTINGS
176 /* Settings for
THIS-PROCEDURE
180 Add Fields to
: EXTERNAL-TABLES
181 Other Settings
: PERSISTENT-ONLY
COMPILE
184 /* This procedure should always be
RUN PERSISTENT. Report the error
, */
185 /* then cleanup and return.
*/
186 IF NOT THIS-PROCEDURE:PERSISTENT THEN DO:
187 MESSAGE "{&FILE-NAME} should only be RUN PERSISTENT."
188 VIEW-AS ALERT-BOX ERROR BUTTONS OK.
192 &ANALYZE-RESUME _END-PROCEDURE-SETTINGS
194 /* ************************* Create Window
************************** */
196 &ANALYZE-SUSPEND _CREATE-WINDOW
197 /* DESIGN Window definition
(used by the UIB
)
198 CREATE WINDOW B-table-Win
ASSIGN
201 /* END WINDOW DEFINITION
*/
206 /* *************** Runtime Attributes and UIB Settings
************** */
208 &ANALYZE-SUSPEND _RUN-TIME-ATTRIBUTES
209 /* SETTINGS
FOR WINDOW B-table-Win
210 NOT-VISIBLE
,,RUN-PERSISTENT
*/
211 /* SETTINGS
FOR FRAME F-Main
212 NOT-VISIBLE Size-to-Fit
*/
213 /* BROWSE-TAB br_table
1 F-Main
*/
215 FRAME F-Main
:SCROLLABLE = FALSE
216 FRAME F-Main
:HIDDEN = TRUE.
218 /* _RUN-TIME-ATTRIBUTES-END
*/
222 /* Setting information for Queries and Browse Widgets fields
*/
224 &ANALYZE-SUSPEND _QUERY-BLOCK BROWSE br_table
225 /* Query rebuild information for
BROWSE br_table
226 _TblList
= "ttpl.Project"
227 _Options
= "NO-LOCK KEY-PHRASE SORTBY-PHRASE"
228 _Where
[1] = "(IF show-completed THEN (Project.CompleteDate < TODAY) ELSE (Project.CompleteDate = ? OR Project.CompleteDate >= TODAY ))
229 AND Project.Name BEGINS filter-value"
230 _FldNameList
[1] > TTPL.Project.ProjectCode
231 "Project.ProjectCode" "Project" ?
"integer" ? ? ? ? ? ? no ?
232 _FldNameList
[2] > TTPL.Project.ExpenditureType
233 "Project.ExpenditureType" "T" "X" "character" ? ? ? ? ? ? no ?
234 _FldNameList
[3] > TTPL.Project.Name
235 "Project.Name" ?
"X(55)" "character" ? ? ? ? ? ? no ?
236 _FldNameList
[4] > "_<CALC>"
237 "STRING( Project.StartDate, '99/99/9999') @ d-date-1" " Start Date" "X(12)" ? ? ? ? ? ? ? no ?
238 _FldNameList
[5] > "_<CALC>"
239 "(IF Project.CompleteDate <> ? THEN STRING( Project.CompleteDate, '99/99/9999') ELSE '') @ d-date-2" " End Date" "X(12)" ? ? ? ? ? ? ? no ?
241 */ /* BROWSE br_table
*/
244 &ANALYZE-SUSPEND _QUERY-BLOCK FRAME F-Main
245 /* Query rebuild information for
FRAME F-Main
248 */ /* FRAME F-Main
*/
254 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _INCLUDED-LIB B-table-Win
255 /* ************************* Included-Libraries
*********************** */
257 {src
/adm
/method
/browser.i
}
258 {inc
/method
/m-selvwr.i
}
260 /* _UIB-CODE-BLOCK-END
*/
266 /* ************************ Control Triggers
************************ */
268 &Scoped-define BROWSE-NAME br_table
269 &Scoped-define SELF-NAME br_table
270 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL br_table B-table-Win
271 ON ROW-ENTRY
OF br_table
IN FRAME F-Main
273 /* This code displays initial values for newly added or copied rows.
*/
274 {src
/adm
/template
/brsentry.i
}
277 /* _UIB-CODE-BLOCK-END
*/
281 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL br_table B-table-Win
282 ON ROW-LEAVE
OF br_table
IN FRAME F-Main
284 /* Do not disable this code or no updates will take place except
285 by pressing the Save button on an Update SmartPanel.
*/
286 {src
/adm
/template
/brsleave.i
}
289 /* _UIB-CODE-BLOCK-END
*/
293 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL br_table B-table-Win
294 ON VALUE-CHANGED
OF br_table
IN FRAME F-Main
296 /* This ADM trigger code must be preserved in order to notify other
297 objects when the browser's current row changes.
*/
298 {src
/adm
/template
/brschnge.i
}
302 /* _UIB-CODE-BLOCK-END
*/
308 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _MAIN-BLOCK B-table-Win
311 /* *************************** Main Block
*************************** */
313 &IF DEFINED(UIB_IS_RUNNING) <> 0 &THEN
314 RUN dispatch
IN THIS-PROCEDURE ('initialize'
:U
).
317 RUN set-attribute-list
( 'SortBy-Options
= Code|Name|Entity
, SortBy-Case
= Code'
:U
).
318 RUN set-attribute-list
( 'FilterBy-Options
= Not Completed|Completed
, FilterBy-Case
= Not Completed'
:U
).
319 RUN set-attribute-list
( 'Filter-Value
= '
:U
).
321 /* _UIB-CODE-BLOCK-END
*/
325 /* ********************** Internal Procedures
*********************** */
327 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE adm-open-query-cases B-table-Win adm/support/_adm-opn.p
328 PROCEDURE adm-open-query-cases
:
329 /*------------------------------------------------------------------------------
330 Purpose
: Opens different cases of the query based on attributes
331 such as the 'Key-Name'
, or 'SortBy-Case'
333 ------------------------------------------------------------------------------*/
334 DEF VAR key-value
AS CHAR NO-UNDO.
336 /* Look up the current key-value.
*/
337 RUN get-attribute
('Key-Value'
:U
).
338 key-value
= RETURN-VALUE.
340 /* Find the current record using the current Key-Name.
*/
341 RUN get-attribute
('Key-Name'
:U
).
343 WHEN 'EntityCode'
:U
THEN DO:
344 &Scope KEY-PHRASE Project.EntityCode eq INTEGER(key-value)
345 RUN get-attribute
('SortBy-Case'
:U
).
347 WHEN 'Entity'
:U
THEN DO:
348 &Scope SORTBY-PHRASE BY Project.EntityType BY Project.EntityCode
349 {&OPEN-QUERY-{&BROWSE-NAME}}
351 WHEN 'Code'
:U
THEN DO:
352 &Scope SORTBY-PHRASE BY Project.ProjectCode
353 {&OPEN-QUERY-{&BROWSE-NAME}}
355 WHEN 'Name'
:U
THEN DO:
356 &Scope SORTBY-PHRASE BY Project.Name
357 {&OPEN-QUERY-{&BROWSE-NAME}}
360 &Undefine SORTBY-PHRASE
361 {&OPEN-QUERY-{&BROWSE-NAME}}
362 END.
/* OTHERWISE...
*/
364 END.
/* EntityCode
*/
365 WHEN 'FirstApprover'
:U
THEN DO:
366 &Scope KEY-PHRASE Project.FirstApprover eq key-value
367 RUN get-attribute
('SortBy-Case'
:U
).
369 WHEN 'Entity'
:U
THEN DO:
370 &Scope SORTBY-PHRASE BY Project.EntityType BY Project.EntityCode
371 {&OPEN-QUERY-{&BROWSE-NAME}}
373 WHEN 'Code'
:U
THEN DO:
374 &Scope SORTBY-PHRASE BY Project.ProjectCode
375 {&OPEN-QUERY-{&BROWSE-NAME}}
377 WHEN 'Name'
:U
THEN DO:
378 &Scope SORTBY-PHRASE BY Project.Name
379 {&OPEN-QUERY-{&BROWSE-NAME}}
382 &Undefine SORTBY-PHRASE
383 {&OPEN-QUERY-{&BROWSE-NAME}}
384 END.
/* OTHERWISE...
*/
386 END.
/* FirstApprover
*/
387 WHEN 'Proposer'
:U
THEN DO:
388 &Scope KEY-PHRASE Project.Proposer eq INTEGER(key-value)
389 RUN get-attribute
('SortBy-Case'
:U
).
391 WHEN 'Entity'
:U
THEN DO:
392 &Scope SORTBY-PHRASE BY Project.EntityType BY Project.EntityCode
393 {&OPEN-QUERY-{&BROWSE-NAME}}
395 WHEN 'Code'
:U
THEN DO:
396 &Scope SORTBY-PHRASE BY Project.ProjectCode
397 {&OPEN-QUERY-{&BROWSE-NAME}}
399 WHEN 'Name'
:U
THEN DO:
400 &Scope SORTBY-PHRASE BY Project.Name
401 {&OPEN-QUERY-{&BROWSE-NAME}}
404 &Undefine SORTBY-PHRASE
405 {&OPEN-QUERY-{&BROWSE-NAME}}
406 END.
/* OTHERWISE...
*/
409 WHEN 'EntityType'
:U
THEN DO:
410 &Scope KEY-PHRASE Project.EntityType eq key-value
411 RUN get-attribute
('SortBy-Case'
:U
).
413 WHEN 'Entity'
:U
THEN DO:
414 &Scope SORTBY-PHRASE BY Project.EntityType BY Project.EntityCode
415 {&OPEN-QUERY-{&BROWSE-NAME}}
417 WHEN 'Code'
:U
THEN DO:
418 &Scope SORTBY-PHRASE BY Project.ProjectCode
419 {&OPEN-QUERY-{&BROWSE-NAME}}
421 WHEN 'Name'
:U
THEN DO:
422 &Scope SORTBY-PHRASE BY Project.Name
423 {&OPEN-QUERY-{&BROWSE-NAME}}
426 &Undefine SORTBY-PHRASE
427 {&OPEN-QUERY-{&BROWSE-NAME}}
428 END.
/* OTHERWISE...
*/
430 END.
/* EntityType
*/
432 &Scope KEY-PHRASE TRUE
433 RUN get-attribute
('SortBy-Case'
:U
).
435 WHEN 'Entity'
:U
THEN DO:
436 &Scope SORTBY-PHRASE BY Project.EntityType BY Project.EntityCode
437 {&OPEN-QUERY-{&BROWSE-NAME}}
439 WHEN 'Code'
:U
THEN DO:
440 &Scope SORTBY-PHRASE BY Project.ProjectCode
441 {&OPEN-QUERY-{&BROWSE-NAME}}
443 WHEN 'Name'
:U
THEN DO:
444 &Scope SORTBY-PHRASE BY Project.Name
445 {&OPEN-QUERY-{&BROWSE-NAME}}
448 &Undefine SORTBY-PHRASE
449 {&OPEN-QUERY-{&BROWSE-NAME}}
450 END.
/* OTHERWISE...
*/
452 END.
/* OTHERWISE...
*/
457 /* _UIB-CODE-BLOCK-END
*/
461 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE adm-row-available B-table-Win _ADM-ROW-AVAILABLE
462 PROCEDURE adm-row-available
:
463 /*------------------------------------------------------------------------------
464 Purpose
: Dispatched to this procedure when the Record-
465 Source has a new row available. This procedure
466 tries to get the new row
(or foriegn keys
) from
467 the Record-Source and process it.
469 ------------------------------------------------------------------------------*/
471 /* Define variables needed by this internal procedure.
*/
472 {src
/adm
/template
/row-head.i
}
474 /* Process the newly available records
(i.e. display fields
,
475 open queries
, and
/or pass records on to any RECORD-TARGETS
).
*/
476 {src
/adm
/template
/row-end.i
}
480 /* _UIB-CODE-BLOCK-END
*/
484 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE disable_UI B-table-Win _DEFAULT-DISABLE
485 PROCEDURE disable_UI
:
486 /*------------------------------------------------------------------------------
487 Purpose
: DISABLE the User Interface
489 Notes
: Here we clean-up the user-interface by deleting
490 dynamic widgets we have created and
/or hide
491 frames. This procedure is usually called when
492 we are ready to
"clean-up" after running.
493 ------------------------------------------------------------------------------*/
494 /* Hide all frames.
*/
496 IF THIS-PROCEDURE:PERSISTENT THEN DELETE PROCEDURE THIS-PROCEDURE.
499 /* _UIB-CODE-BLOCK-END
*/
503 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE local-delete-record B-table-Win
504 PROCEDURE local-delete-record
:
505 /*------------------------------------------------------------------------------
506 Purpose
: Override standard ADM method
508 ------------------------------------------------------------------------------*/
509 IF NOT AVAILABLE(Project
) THEN RETURN.
511 /* Code placed here will execute PRIOR to standard behavior.
*/
512 IF CAN-FIND( FIRST AcctTran
WHERE AcctTran.EntityType
= "J"
513 AND AcctTran.EntityCode
= Project.ProjectCode
) THEN DO:
514 MESSAGE "Cannot delete project as posted transactions exist."
515 VIEW-AS ALERT-BOX ERROR.
519 DO TRANSACTION ON ERROR UNDO, LEAVE:
520 FOR EACH AccountBalance
WHERE AccountBalance.EntityType
= "J" AND
521 AccountBalance.EntityCode
= Project.ProjectCode
:
522 DELETE AccountBalance.
524 FOR EACH ProjectBudget
OF Project
:
525 DELETE ProjectBudget.
527 FIND CURRENT Project
EXCLUSIVE-LOCK.
530 RUN dispatch
( 'open-query'
:U
).
534 /* _UIB-CODE-BLOCK-END
*/
538 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE send-key B-table-Win adm/support/_key-snd.p
540 /*------------------------------------------------------------------------------
541 Purpose
: Sends a requested
KEY value back to the calling
543 Parameters
: <see adm
/template
/sndkytop.i
>
544 ------------------------------------------------------------------------------*/
546 /* Define variables needed by this internal procedure.
*/
547 {src
/adm
/template
/sndkytop.i
}
549 /* Return the key value associated with each key case.
*/
550 {src
/adm
/template
/sndkycas.i
"ProjectCode" "Project" "ProjectCode"}
551 {src
/adm
/template
/sndkycas.i
"EntityCode" "Project" "EntityCode"}
552 {src
/adm
/template
/sndkycas.i
"FirstApprover" "Project" "FirstApprover"}
553 {src
/adm
/template
/sndkycas.i
"Proposer" "Project" "Proposer"}
554 {src
/adm
/template
/sndkycas.i
"EntityType" "Project" "EntityType"}
556 /* Close the
CASE statement and end the procedure.
*/
557 {src
/adm
/template
/sndkyend.i
}
561 /* _UIB-CODE-BLOCK-END
*/
565 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE send-records B-table-Win _ADM-SEND-RECORDS
566 PROCEDURE send-records
:
567 /*------------------------------------------------------------------------------
568 Purpose
: Send record
ROWID's for all tables used by
570 Parameters
: see template
/snd-head.i
571 ------------------------------------------------------------------------------*/
573 /* Define variables needed by this internal procedure.
*/
574 {src
/adm
/template
/snd-head.i
}
576 /* For each requested table
, put it's
ROWID in the output list.
*/
577 {src
/adm
/template
/snd-list.i
"Project"}
579 /* Deal with any unexpected table requests before closing.
*/
580 {src
/adm
/template
/snd-end.i
}
584 /* _UIB-CODE-BLOCK-END
*/
588 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE state-changed B-table-Win
589 PROCEDURE state-changed
:
590 /* -----------------------------------------------------------
594 -------------------------------------------------------------*/
595 DEFINE INPUT PARAMETER p-issuer-hdl
AS HANDLE NO-UNDO.
596 DEFINE INPUT PARAMETER p-state
AS CHARACTER NO-UNDO.
599 /* Object instance CASEs can go here to replace standard behavior
601 {src
/adm
/template
/bstates.i
}
605 /* _UIB-CODE-BLOCK-END
*/
609 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE use-Filter-Value B-table-Win
610 PROCEDURE use-Filter-Value
:
611 /*------------------------------------------------------------------------------
615 ------------------------------------------------------------------------------*/
617 DEF INPUT PARAMETER new-filter-value
AS CHAR NO-UNDO.
618 filter-value
= new-filter-value.
622 /* _UIB-CODE-BLOCK-END
*/
626 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE use-FilterBy-Case B-table-Win
627 PROCEDURE use-FilterBy-Case
:
628 /*------------------------------------------------------------------------------
632 ------------------------------------------------------------------------------*/
634 DEF INPUT PARAMETER new-filterby-case
AS CHAR NO-UNDO.
635 show-completed
= (new-filterby-case
= "Completed").
639 /* _UIB-CODE-BLOCK-END
*/