This code is not getting me to the appropriate key values - it keeps breaking where I have the ****. The statement should kick me out of the loop after I have cycled through all ketyed records with the same closure value. But when I do the SET ... NEXT for values of 0 or 1, it is not finding the correct values. MOD:ClosureStatus is being set properly. HELP!!!
! MOD: values are MODULE variables.
CLEAR(MOD:ClosureStatus) ; CLEAR(MODueDate); CLEAR(MODivision) ; CLEAR(MOD:Owner) ; CLEAR(MOD:Category) ; CLEAR(MOD:ExcludeZeroDueDates)
CLEAR(GLO:FirstDate) ; CLEAR(GLO:LastDate)
BIND(IS1:Record) ; BIND(IS2:Record) ; BIND(IS3:Record) ; BIND(ALL:Record)
EMPTY(AllIssues) ; CLEAR(IS1:Record) ; CLEAR(IS2:Record) ; CLEAR(IS3:Record)
ReportCriteria ! sets the MOD: criteria values
! Select from IS1, IS2, IS3 using criteria from ReportCriteria, and place in the MEM file ALLISSUES
! ISSUES1 PROCESSING ================================================
message('before case' & '|' & 'IS1:Closed = ' & IS1:Closed & '|' & 'MOD:ClosureStatus = ' & MOD:ClosureStatus)
CASE MOD:ClosureStatus ! set keys to speed processing
OF 0 OROF 1 ! 0=Open , 1=Closed , 2=All records
IS1:Closed = MOD:ClosureStatus
IS1:Issue1Date = 0 ! clear second element of key for good SET ... NEXT result
SET(IS1:Closure,IS1:Closure)
OF 2
SET(Issues1)
.
LOOP
NEXT(Issues1)
IF ERROR() THEN BREAK.
IF MOD:ClosureStatus < 2 ! open or closed
**** IF IS1:Closed <> MOD:ClosureStatus THEN BREAK.
.
IF IS1ueDate = 0 AND MOD:ExcludeZeroDueDates = 1
CYCLE
.
IF MODueDate = IS1ueDate AND IS1ueDate > 0
DO AddIssue1 ; CYCLE
.
.
! MOD: values are MODULE variables.
CLEAR(MOD:ClosureStatus) ; CLEAR(MODueDate); CLEAR(MODivision) ; CLEAR(MOD:Owner) ; CLEAR(MOD:Category) ; CLEAR(MOD:ExcludeZeroDueDates)
CLEAR(GLO:FirstDate) ; CLEAR(GLO:LastDate)
BIND(IS1:Record) ; BIND(IS2:Record) ; BIND(IS3:Record) ; BIND(ALL:Record)
EMPTY(AllIssues) ; CLEAR(IS1:Record) ; CLEAR(IS2:Record) ; CLEAR(IS3:Record)
ReportCriteria ! sets the MOD: criteria values
! Select from IS1, IS2, IS3 using criteria from ReportCriteria, and place in the MEM file ALLISSUES
! ISSUES1 PROCESSING ================================================
message('before case' & '|' & 'IS1:Closed = ' & IS1:Closed & '|' & 'MOD:ClosureStatus = ' & MOD:ClosureStatus)
CASE MOD:ClosureStatus ! set keys to speed processing
OF 0 OROF 1 ! 0=Open , 1=Closed , 2=All records
IS1:Closed = MOD:ClosureStatus
IS1:Issue1Date = 0 ! clear second element of key for good SET ... NEXT result
SET(IS1:Closure,IS1:Closure)
OF 2
SET(Issues1)
.
LOOP
NEXT(Issues1)
IF ERROR() THEN BREAK.
IF MOD:ClosureStatus < 2 ! open or closed
**** IF IS1:Closed <> MOD:ClosureStatus THEN BREAK.
.
IF IS1ueDate = 0 AND MOD:ExcludeZeroDueDates = 1
CYCLE
.
IF MODueDate = IS1ueDate AND IS1ueDate > 0
DO AddIssue1 ; CYCLE
.
.