<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2900.2769" name=GENERATOR></HEAD>
<BODY style="MARGIN: 4px 4px 1px; FONT: 10pt Verdana">
<DIV>O.K., I'm really puzzled on this one. </DIV>
<DIV> </DIV>
<DIV>I have a virtual field that calls a subroutine. In LIST statements it works fine, but DOWNLOAD gives a segmentation fault.</DIV>
<DIV> </DIV>
<DIV>First the error:</DIV>
<DIV> </DIV>
<DIV><FONT face="Courier New">:GET.LIST TEST.DVP<BR>10 records retrieved to list 0.<BR>>DOWNLOAD STUDENTS STU.DMD.CREDITS FORMAT FIXED<BR>DOWNLOAD version 7.12<BR>Using input file STUDENTS<BR>Output to screen</FONT></DIV>
<DIV><FONT face="Courier New"></FONT> </DIV>
<DIV><FONT face="Courier New">Segmentation fault<BR>ibmp630:/datatel/live/collive $</FONT></DIV>
<DIV> </DIV>
<DIV>The virtual field code is:</DIV>
<DIV> </DIV>
<DIV><FONT face="Courier New">SUBR("DELTA.MU.DELTA.CREDITS",STUDENTS.ID)</FONT></DIV>
<DIV> </DIV>
<DIV>And the DELTA.MU.DELTA.CREDITS subroutine code is:</DIV>
<DIV> </DIV>
<DIV><FONT face="Courier New">SUBROUTINE DELTA.MU.DELTA.CREDITS(RESULT,ID.NO)<BR>* TAKES AN ID NUMBER AND RETURNS A TOTAL NUMBER CREDITS EARNED FOR<BR>* DELTA MU DELTA REPORT<BR>COMMON /DMDCRED/ OPENED, F.TRANS.GROUP, F.STUD.ACAD.CRED, F.STU.ACAD.LEVEL, ACAD.LEVELS<BR>IF NOT(OPENED) THEN<BR> OPEN '','TRANSCRIPT.GROUPINGS' TO F.TRANS.GROUP<BR> ELSE STOP "UNABLE TO OPEN TRANSCRIPT GROUPING FILE"<BR> OPEN '','STUDENT.ACAD.CRED' TO F.STUD.ACAD.CRED<BR> ELSE STOP "UNABLE TO OPEN STUDENT.ACAD.CRED FILE"<BR> OPEN '','STUDENT.ACAD.LEVELS' TO F.STU.ACAD.LEVEL<BR> ELSE STOP "UNABLE TO OPEN STUDENT.ACAD.LEVELS FILE"<BR> READ TG.REC FROM F.TRANS.GROUP, 'MB'<BR> ELSE TG.REC = ''<BR> ACAD.LEVELS = TG.REC<2><BR> OPENED = 1<BR>END<BR>*<BR>X.TOTAL = 0<BR>RESULT = 0<BR>ACAD.LEVEL.COUNT = DCOUNT(ACAD.LEVELS,@VM)<BR>FOR LEVEL = 1 TO ACAD.LEVEL.COUNT<BR> READ STA.REC FROM F.STU.ACAD.LEVEL,ID.NO:'*':ACAD.LEVELS<1,LEVEL> THEN<BR> STUDENT.ACAD.CRED = STA.REC<10><BR> CRED.COUNT = DCOUNT(STUDENT.ACAD.CRED,@VM)<BR> FOR I = 1 TO CRED.COUNT<BR> READ STC.REC FROM F.STUD.ACAD.CRED,STUDENT.ACAD.CRED<1,I> THEN <BR> IF STC.REC<13> GT 0 THEN<BR> X.TOTAL += STC.REC<13><BR> END<BR> END<BR> NEXT I<BR> END<BR>NEXT LEVEL<BR>*<BR>IF X.TOTAL THEN <BR> RESULT = OCONV(X.TOTAL,"MD05") <BR>END<BR>*<BR>RETURN RESULT<BR>END</FONT></DIV>
<DIV> </DIV>
<DIV>If I try to do a DOWNLOAD using an EVAL, instead of the virtual field, I get:</DIV>
<DIV> </DIV>
<DIV><FONT face="Courier New">:GET.LIST TEST.DVP<BR>10 records retrieved to list 0.<BR>>DOWNLOAD STUDENTS EVAL 'SUBR("DELTA.MU.DELTA.CREDITS",STUDENTS.ID)'<BR>DOWNLOAD version 7.12<BR>Creating temporary list DLDPREZ40567<BR>10 key(s) saved to 1 record(s).<BR>10 records retrieved to list 1.<BR>Overwriting existing select list.<BR>10 records retrieved to list 1.<BR>Using input file STUDENTS<BR>Output to screen</FONT></DIV>
<DIV><FONT face="Courier New"></FONT> </DIV>
<DIV><FONT face="Courier New">""<BR>""<BR>""<BR>""<BR>""</FONT></DIV>
<DIV><FONT face="Courier New">""<BR>""<BR>""<BR>""<BR>""</FONT></DIV>
<DIV><FONT face="Courier New"></FONT> </DIV>
<DIV><FONT face="Courier New">10 records processed.<BR>Deleting temporary list DLDPREZ40567<BR>'DLDPREZ40567' deleted.<BR>:</FONT></DIV>
<DIV> </DIV>
<DIV>It should be returning some number (if only 0) instead of the null strings. If I do a LIST statement I get:</DIV>
<DIV> </DIV>
<DIV><FONT face="Courier New">:GET.LIST TEST.DVP<BR>10 records retrieved to list 0.<BR>>LIST STUDENTS STU.DMD.CREDITS</FONT></DIV>
<DIV><BR><FONT face="Courier New">LIST STUDENTS STU.DMD.CREDITS 11:31:21 Nov 03 2005 1<BR>STUDENTS.. STU.D</FONT></DIV>
<DIV><FONT face="Courier New"></FONT> </DIV>
<DIV><FONT face="Courier New">0936711 27<BR>0816629 16<BR>0896532 18<BR>0936713 12<BR>0936719 18<BR>0736451 18<BR>0976714 6<BR>0616439 28<BR>0896540 17<BR>0556488 12<BR>10 records listed</FONT></DIV>
<DIV> </DIV>
<DIV>I have messed around with the subroutine code (there didn't used to be common, and it didn't used to verify the presence of data) to no avail. Any ideas?</DIV>
<DIV> </DIV>
<DIV>Thanks</DIV>
<DIV> </DIV>
<DIV>Don<BR></DIV>
<DIV> </DIV>
<DIV>--<BR>Don Prezioso<BR>Director of Administrative Systems<BR>Ashland University<BR>Ashland, Ohio</DIV></BODY></HTML>