Ok, now that I have solved those strange sintax errors (thanks Darrel) I'm going on investigating why I have unexpected resets on my PIC18LF4680.
This project runs fine since many years, but after some modifications, after upgraded to PBP3 and ICD3, I see this strange behaviour. I try to explain:

Assume the program is simple:
1) wait for a button in a cycle
2) the button is pressed, the program do somethings and then go back to point 1, waiting again for the button.

It happens sometimes, very rarely, that I fall in a strange situation:

The button is pressed, the programs starts to do something but after a few seconds I see a reset.
When I fall in this situation, I can continue pressing the button and the PIC will resets again after a few seconds. Only an hardware reset allow to exit from this situation, then the programs continue to run ok, but running and running, sooner or later I will fall again in this bug.

I'm not asking you why this happen, I know it is almost impossible to understand without be here with me, but ... what can I do to investigate ?

I was thinking to a stack overflow, (the STVREN is set to ON). I've put a "debug #STKPTR" at the beginning of the program but I see always 0.
I was thinking to the watchdog, but PBP should manage it well.
Anyway I have added a STKPTR=0 and a CLEARDWT in some points with no success.

Whick kind of investigation can I do to discover the cause of the reset ? Observe some registers at the beginning ?
I don't know if it is possible to ask help like this but I try ...
Marco