Add missing brackets.
[capital-apms-progress.git] / process / calcfreq.p
blobb8ced8a147f1d4ad313ccab4e92ca8cc8e61dbda
1 &ANALYZE-SUSPEND _VERSION-NUMBER UIB_v8r11
2 &ANALYZE-RESUME
3 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _DEFINITIONS Procedure
4 /*--------------------------------------------------------------------------
5 ------------------------------------------------------------------------*/
7 DEF INPUT PARAMETER freq-code LIKE FrequencyType.FrequencyCode NO-UNDO.
8 DEF OUTPUT PARAMETER fraction AS DEC NO-UNDO.
10 /* _UIB-CODE-BLOCK-END */
11 &ANALYZE-RESUME
14 &ANALYZE-SUSPEND _UIB-PREPROCESSOR-BLOCK
16 /* ******************** Preprocessor Definitions ******************** */
18 &Scoped-define PROCEDURE-TYPE Procedure
22 /* _UIB-PREPROCESSOR-BLOCK-END */
23 &ANALYZE-RESUME
27 /* *********************** Procedure Settings ************************ */
29 &ANALYZE-SUSPEND _PROCEDURE-SETTINGS
30 /* Settings for THIS-PROCEDURE
31 Type: Procedure
32 Allow:
33 Frames: 0
34 Add Fields to: Neither
35 Other Settings: CODE-ONLY COMPILE
37 &ANALYZE-RESUME _END-PROCEDURE-SETTINGS
39 /* ************************* Create Window ************************** */
41 &ANALYZE-SUSPEND _CREATE-WINDOW
42 /* DESIGN Window definition (used by the UIB)
43 CREATE WINDOW Procedure ASSIGN
44 HEIGHT = .1
45 WIDTH = 40.
47 &ANALYZE-RESUME
52 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _MAIN-BLOCK Procedure
55 /* *************************** Main Block *************************** */
57 FIND FrequencyType WHERE FrequencyType.FrequencyCode = freq-code
58 NO-LOCK NO-ERROR.
60 IF NOT AVAILABLE FrequencyType THEN RETURN.
62 fraction = Frequencytype.UnitCount *
63 IF RepeatUnits = "DAYS" THEN ( 1 / 365 ) ELSE
64 IF RepeatUnits = "WEEKS" THEN ( 7 / 365 ) ELSE
65 IF RepeatUnits = "MONTHS" THEN ( 1 / 12 ) ELSE
66 IF RepeatUnits = "YEARS" THEN 1 ELSE 0.
68 /* _UIB-CODE-BLOCK-END */
69 &ANALYZE-RESUME