Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

help with basic code

ALV06ALV06 Member Posts: 1
I am trying to count and the write out all the degrees a person has this is my code my output puts "0" in the first column and then fill out the rest corretly need the first column to have the degree information and in the last column in there is no data it should be blank
X.TAB = "" any suggestions would be appreicated
X.INTS.COUNT = DCOUNT(VL.PERSON.INSTITUTIONS.ATTEND,@VM)
FOR IDX1 = 1 TO X.INTS.COUNT
V.INSTA.PERSON.ID = V.ID
V.INSTA.INSTITUTIONS.ID = VL.PERSON.INSTITUTIONS.ATTEND<1,IDX1>
KEY.INSTITUTIONS.ATTEND = V.INSTA.PERSON.ID:"*":V.INSTA.INSTITUTIONS.ID
FOR_THIS INSTA.INSTITUTIONS.ID
X.ACAD.COUNT = DCOUNT(VL.INSTA.ACAD.CREDENTIALS,@VM)
FOR IDX2 = 1 TO X.ACAD.COUNT
V.ACAD.CREDENTIALS.ID = VL.INSTA.ACAD.CREDENTIALS<1,IDX2>
FOR_THIS ACAD.CREDENTIALS.ID
IF V.ACAD.INSTITUTIONS.ID EQ "0000001" THEN
V.CORP.ID = V.ACAD.INSTITUTIONS.ID
FOR_THIS CORP.ID
XL.INST.ALV<1,-1> = VL.CORP.NAME
END_THIS CORP.ID
XL.DEGREE.ALV<1,-1> = V.ACAD.DEGREE
XL.DEGREE.DATE.ALV<1,-1> = OCONV(V.ACAD.DEGREE.DATE,"DY")
XL.MAJOR1.ALV<1,-1> = VL.ACAD.MAJORS<1,1>
XL.MAJOR2.ALV<1,-1> = VL.ACAD.MAJORS<1,2>
END ELSE
V.CORP.ID = V.ACAD.INSTITUTIONS.ID
FOR_THIS CORP.ID
XL.INST<1,-1> = VL.CORP.NAME
END_THIS CORP.ID
XL.DEGREE<1,-1> = V.ACAD.DEGREE
XL.DEGREE.DATE<1,-1> = OCONV(V.ACAD.DEGREE.DATE,"DY")
XL.MAJOR1<1,-1> = VL.ACAD.MAJORS<1,1>
END
END_THIS ACAD.CREDENTIALS.ID
NEXT IDX2
END_THIS INSTA.INSTITUTIONS.ID
NEXT IDX1
X.DEG.INFO.A = ""
X.DEG.A = DCOUNT(XL.DEGREE.ALV,@VM)
IF X.DEG.A >= 4 THEN
X.DEG.A = 4
END
X.SPARE.A = 4 - X.DEG.A
FOR IDXDA = 1 TO X.DEG.A
X.DEG.INFO.A := XL.DEGREE.ALV<1,IDXDA>:X.TAB
X.DEG.INFO.A := XL.DEGREE.DATE.ALV<1,IDXDA>:X.TAB
X.DEG.INFO.A := XL.INST.ALV<1,IDXDA>:X.TAB
X.DEG.INFO.A := XL.MAJOR1.ALV<1,IDXDA>:X.TAB
X.DEG.INFO.A := XL.MAJOR2.ALV<1,IDXDA>:X.TAB
NEXT IDXDA
IF X.SPARE.A >= 1 THEN
FOR IDXEA = 1 TO X.SPARE.A
X.DEG.INFO.A := X.TAB:X.TAB:X.TAB:X.TAB:X.TAB
NEXT IDXEA
END
X.DEG.INFO = ""
X.DEG = DCOUNT(XL.DEGREE,@VM)
IF X.DEG >= 4 THEN
X.DEG = 4
END
X.SPARE = 4 - X.DEG
FOR IDXD = 1 TO X.DEG
X.DEG.INFO = ""
X.DEG.INFO := X.TAB:XL.DEGREE<1,IDXD>
X.DEG.INFO := X.TAB:XL.DEGREE.DATE<1,IDXD>
X.DEG.INFO := X.TAB:XL.INST<1,IDXD>
X.DEG.INFO := X.TAB:XL.MAJOR1<1,IDXD>
NEXT IDXD
IF X.SPARE >= 1 THEN
FOR IDXE = 1 TO X.SPARE
X.DEG.INFO := X.TAB:X.TAB:X.TAB:X.TAB:X.TAB
NEXT IDXE
END

Sign In or Register to comment.