Home > Archive > Clipper > September 2006 > Compiling error E0030 with xharbour.
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Compiling error E0030 with xharbour.
|
|
|
| Hi All,
Maybe someone has run in to his before. I am trying to compile (to a
library) in xharbour, but am receiving an error E0030. The description
is vague and I'm racking my brain trying to figure out why it is
complaing.
The code that is causing the error is in a static function and is as
follows:
//*
static function dupefields(a_, x)
local ele
local y := trim(a_[x][DBS_NAME] )
IF ( ele := ascan(a_, { | field | field[DBS_NAME] == y } ) ) > 0 .and.
ele < x // line that supposedly has syntax error
IF ( ele := len(y) ) > 9
y := left(y, 9)
ENDIF
y += "2"
a_[x][DBS_NAME] := y
ENDIF // <== line that
xharbour indicates does not match
return nil
//*
I have the dbstruct.ch included. The error message I get is as
follows:
Error E0030 Syntax error: "syntax error at '1"
Error E0010 ENDIF does not match IF
| |
| Ross McKenzie 2006-09-12, 6:55 pm |
| On 12 Sep 2006 14:23:00 -0700, "Mack" <mbarss@shaw.ca> wrote:
>Hi All,
>
>Maybe someone has run in to his before. I am trying to compile (to a
>library) in xharbour, but am receiving an error E0030. The description
>is vague and I'm racking my brain trying to figure out why it is
>complaing.
>
>The code that is causing the error is in a static function and is as
>follows:
>
>//*
>static function dupefields(a_, x)
>local ele
>local y := trim(a_[x][DBS_NAME] )
>
>IF ( ele := ascan(a_, { | field | field[DBS_NAME] == y } ) ) > 0 .and.
>ele < x // line that supposedly has syntax error
> IF ( ele := len(y) ) > 9
> y := left(y, 9)
> ENDIF
> y += "2"
> a_[x][DBS_NAME] := y
>ENDIF // <== line that
>xharbour indicates does not match
>return nil
>//*
>
>I have the dbstruct.ch included. The error message I get is as
>follows:
>
> Error E0030 Syntax error: "syntax error at '1"
> Error E0010 ENDIF does not match IF
>
Mack,
I think that you will get replies in the xHarbour.org newsgroup.
Regards,
Ross McKenzie
ValuSoft
Melbourne Australia
valusoft AT optusnet DOT com DOT au
| |
| Stephen Quinn 2006-09-12, 9:55 pm |
| Mack
Probably not the cause of your problem
> local y := trim(a_[x][DBS_NAME] )
Here you trim the name (not sure the trim is even required)
> IF ( ele := ascan(a_, { | field | field[DBS_NAME] == y } ) ) > 0 .and.
Here you compare the trimmed name against an untrimmed name in the same array
(== exact match)
> Error E0030 Syntax error: "syntax error at '1"
> Error E0010 ENDIF does not match IF
You get the second because of the first one (syntax error)
You might look at changing the use of 'field' as the codeblock element name
ie in regard to your syntax error
HTH
Steve
| |
| Chen Kedem 2006-09-13, 3:55 am |
| Mack,
Both CA-Clipper 5.2e and Harbour 46.2 compile this program
without a problem (after I add #Include "dbstruct.ch").
The problem IS shown if the following line is actually TWO
lines:
IF ( ele := ascan(a_, { | field | field[DBS_NAME] == y } ) ) > 0 .and.
ele < x
the "ele < x" must be on the same line else you must put ;
at the and of the line above.
Chen.
|
|
|
|
|