SUM error: solved

Forum dedicato ai programmatori di X# in lingua italiana – Italian language forum

Moderator: wriedmann

Post Reply
User avatar
Gfb22
Posts: 105
Joined: Sat Oct 08, 2022 7:43 pm
Location: Italy

SUM error: solved

Post by Gfb22 »

Nella mia ultima app utilizzo in diverse occasioni il comando SUM.In tre occasioni il compilatore mi da gli errori che allego.
ErrSUM.jpg
ErrSUM.jpg (52.69 KiB) Viewed 2054 times
Di seguito il codice che da errore:

Code: Select all

SUM Tabella->T_IMPORTE TO fAA ;
	WHILE Tabella->T_DATA < AnnoStart ;
	FOR (Tabella->T_CATEG == "45"  .or. Tabella->T_CATEG == "46"  .or. Tabella->T_CATEG == "50"  .or. Tabella->T_CATEG == "70")
..e la line 403 del comando SUM:

Code: Select all

#command SUM  [<x1> [, <xn>]  TO  <v1> [, <vn>] ]                       ;
         [FOR <lfor>]                                                   ;
         [WHILE <lwhile>]                                               ;
         [NEXT <nnext>]                                                 ;
         [RECORD <rec>]                                                 ;
         [<rest:REST>]                                                  ;
         [<noopt: NOOPTIMIZE>]                                          ;
         [ALL]                                                          ;
                                                                        ;
      => <v1> := [ <vn> := ] 0                                          ;==> line 403
       ; DbEval(                                                        ;
               {|| <v1> += <x1> [, <vn> += <xn> ]},                     ;
               <{lfor}>, <{lwhile}>, <nnext>, <rec>, <.rest.>, <.noopt.>;
               )
Come risolvere?
Grazie!
gfb
User avatar
Chris
Posts: 4977
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

SUM: errore compilatore

Post by Chris »

Hi GIanluca,

This looks like a preprocessor bug. Will log a report about it, in the meantime, please try adding the following in the beginning of your prg, does it work ok now?

Code: Select all

#command SUM  <x1> [, <xn>]  TO  <v1> [, <vn>]                          ;
         [FOR <lfor>]                                                   ;
         [WHILE <lwhile>]                                               ;
         [NEXT <nnext>]                                                 ;
         [RECORD <rec>]                                                 ;
         [<rest:REST>]                                                  ;
         [<noopt: NOOPTIMIZE>]                                          ;
         [ALL]                                                          ;
                                                                        ;
      => <v1> := [ <vn> := ] 0                                          ;
       ; DbEval(                                                        ;
               {|| <v1> += <x1> [, <vn> += <xn> ]},                     ;
               <{lfor}>, <{lwhile}>, <nnext>, <rec>, <.rest.>, <.noopt.>;
               )
.
Chris Pyrgas

XSharp Development Team
chris(at)xsharp.eu
User avatar
Gfb22
Posts: 105
Joined: Sat Oct 08, 2022 7:43 pm
Location: Italy

SUM: errore compilatore

Post by Gfb22 »

Hi Chris,
your code is the same and the error is the same: "error XS9002: Parser: unespected input ':=' "
at line 403, Col 15, in dmcd.xh: ( => <v1> := [ <vn> := ] 0 )
:-)
gfb
User avatar
Gfb22
Posts: 105
Joined: Sat Oct 08, 2022 7:43 pm
Location: Italy

SUM: errore compilatore

Post by Gfb22 »

...in dbcmd.xh....
gfb
User avatar
Chris
Posts: 4977
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

SUM: errore compilatore

Post by Chris »

Hi Gianluca,

It's not exactly the same, it's missing the two outer brackets from the first line of the #command, which is I think what confuses the prerpocessor. If the error message stil points to the dbcmd.xh file, it means that it didn't use the local version of the #command. Are you sure you did put it in the same prg where you are getting the error? If it's in multiple prgs, then you would need to put the #command there as well, or, more simply, adjust the #command inside dbcmd.xh directly. (only for now, this should be fixed in one of the next builds).
Chris Pyrgas

XSharp Development Team
chris(at)xsharp.eu
User avatar
Gfb22
Posts: 105
Joined: Sat Oct 08, 2022 7:43 pm
Location: Italy

SUM: errore compilatore

Post by Gfb22 »

ok: tonight I'll try.
thank you!
gfb
User avatar
Gfb22
Posts: 105
Joined: Sat Oct 08, 2022 7:43 pm
Location: Italy

SUM error: solved

Post by Gfb22 »

Thanks Chris!
I modified the C:Program Files (x86)XSharpIncludedbcmd.xh file
according to your instructions and now it compiles without errors.
:-)
gfb
Post Reply