Page 1 of 1

Server routine compile error in Version 8

Posted: Fri Aug 13, 2010 7:53 am
by lane0001
We are in the process of moving from 7.5.2 to 8.1. One of our server routines that compiles fine in 7.5.2 is receiving a compile error in 8.1.

Any help would be appreciated.

Code: Select all

FUNCTION dukWriteFile(fileName,dynArray,delim)
DEFFUN dukOpenFile(fileName, OpenMode, WriteMode, Logging) CALLING "DSU.dukOpenFile"

LF=char(10)
myName="dukWriteFile"

$INCLUDE UNIVERSE.INCLUDE FILEINFO.H
$UNDEFINE TESTING

ErrorCode = 0
ReadCount = 0
LineCount = 0
SeparatorCount = 0
if delim = "" then del=@FM else del=delim

Call DSLogInfo("file=":fileName, myName)
hTarget = dukOpenFile(fileName, "W", "O", "Y")

numlin=DCOUNT(dynArray, del)
For LinePtr = 1 to numlin
   Line = dynArray<LinePtr> : LF
   WriteSeq Line To hTarget else stop
Next LinePtr

CloseSeq hTarget

$IFDEF TESTING
   Message = "Rows read by routine = " : RowCount
   Message<-1> = "Separators found = " : SeparatorCount
   Message<-1> = "Lines written by routine = " : LineCount
   Message<-1> = "Number of output files = " : Counter
   Call DSLogInfo(Message, "Testing ManyOutputFiles routine")
$ENDIF

Ans=ErrorCode
Error received:
Compiling: Source = 'DSU_BP/DSU.dukWriteFile', Object = 'DSU_BP.O/DSU.dukWriteFile'
**************
0022 WriteSeq Line To hTarget else stop

^
' ' unexpected, Was expecting: FOR control (WHILE/UNTIL/NEXT) or statement,
"GETX", "PRINTERRX", "TRANSACTION", "SETIT", "SEND", "UPRINT",
"AUXMAP"
WARNING: Variable 'Line' never assigned a value.

1 Errors detected, No Object Code Produced.

Posted: Fri Aug 13, 2010 8:13 am
by ArndW
There is something more involved here, since I cut-and-pasted your code to my machine and it compiled without warnings or errors.

If you delete your includes and conditional compile code does the error persist?

Posted: Fri Aug 13, 2010 9:42 am
by lane0001
Thanks for the reply.

I deleted the includes, recompiled, and received the same error.

Posted: Fri Aug 13, 2010 10:42 am
by arunkumarmm
Just include Line = '' in the begining of your routine

Posted: Fri Aug 13, 2010 11:24 am
by lane0001
Arun, the "Line" warning is not the problem. The error is keeping it from compiling. But thanks anyway.

Posted: Sun Aug 15, 2010 2:39 am
by ray.wurlod
The code compiles perfectly well on my machine too (I changed dukOpenFile references to OpenSequentialFile, since that's obviously what it's based on - I do trust that you kept my copyright notice intact as instructed in the original code!).
Try copying and pasting the code from this thread into a new routine and compiling that. Maybe you've introduced a non-printing character into your original routine.

Posted: Mon Aug 16, 2010 3:39 am
by ArndW
By conditional compile I mean the code between the $IFDEF and $ENDIF as well as the $UNDEFINE TESTING line. It shouldn't make a difference, but will make the test routine smaller. Did Ray's suggestion of cut-and-paste to a new routine make a difference?

Posted: Mon Aug 16, 2010 9:33 am
by lane0001
Ray,

Your suggestion of copying the code from this thread worked! Apparently the export/import from 7.5.2 to 8.1 corrupted the code as we are having the same compile issue with this same routine in other projects.

Your copyright notice is intact in our code.

Thanks for your help! Thank you too ArndW.