Source not compiling.

Source not compiling.

Postby HunterEC » Tue Nov 17, 2009 4:23 pm

I'm getting compiler errors on these 2 (red) lines. What is wrong ? Thank you.
The errors are the same.
Error E0030 Syntax error: "syntax error at '['"
Error E0030 Syntax error: "syntax error at '['"

Under Clipper 5.2e they compile with no problems.

// Scatter / Gather
#include "Dbstruct.ch"

#translate Gather(<a>) => AEVAL(<a>, {|x, i| FIELDPUT(i, <a>\[i\]) })

FUNCTION Scatter (aVars, lBlank)
LOCAL nSize := FCOUNT(), aDBStruct, cFieldType
aVars := ARRAY(nSize)

IF lBlank
aDBStruct := DBSTRUCT()
AEVAL(aVars, {|x, nI| aVars[nI] := IIF(aDBStruct[nI,DBS_TYPE] == "N", 0, ;
IIF(aDBStruct[nI, DBS_TYPE] == "C", SPACE(aDBStruct[nI, DBS_LEN]), ;
IIF(aDBStruct[nI, DBS_TYPE] == "D", CTOD(""), ;
IIF(aDBStruct[nI, DBS_TYPE] == "L", .F., " "))))})
ELSE
AEVAL(aVars, {|x, nI| aVars[nI] := FIELDGET(nI)})
ENDIF
RETURN aVars
HunterEC
 
Posts: 723
Joined: Tue Sep 04, 2007 8:45 am

Re: Source not compiling.

Postby nageswaragunupudi » Wed Nov 18, 2009 4:53 am

I am able to compile the above code and execute it without any problems
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10625
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Source not compiling.

Postby James Bott » Wed Nov 18, 2009 12:04 pm

Hunter,

Maybe try looking at the preprocessor output to see if something is being preprocessed incorrectly--perhaps due to the wrong include file being found.

James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: Source not compiling.

Postby HunterEC » Wed Nov 18, 2009 1:55 pm

Thank you guys ! :D
HunterEC
 
Posts: 723
Joined: Tue Sep 04, 2007 8:45 am


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 68 guests