xsharp.eu • SUM error: solved
Page 1 of 1

SUM error: solved

Posted: Fri Jan 06, 2023 7:08 pm
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 1950 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!

SUM: errore compilatore

Posted: Fri Jan 06, 2023 11:09 pm
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.>;
               )
.

SUM: errore compilatore

Posted: Sat Jan 07, 2023 6:27 pm
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 )
:-)

SUM: errore compilatore

Posted: Sat Jan 07, 2023 6:29 pm
by Gfb22
...in dbcmd.xh....

SUM: errore compilatore

Posted: Sat Jan 07, 2023 8:22 pm
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).

SUM: errore compilatore

Posted: Sun Jan 08, 2023 5:44 pm
by Gfb22
ok: tonight I'll try.
thank you!

SUM error: solved

Posted: Mon Jan 09, 2023 8:01 am
by Gfb22
Thanks Chris!
I modified the C:Program Files (x86)XSharpIncludedbcmd.xh file
according to your instructions and now it compiles without errors.
:-)