errsysw - division by zero

Post Reply
User avatar
Otto
Posts: 7020
Joined: Fri Oct 07, 2005 7:07 pm
Contact:

errsysw - division by zero

Post by Otto »

Hello Antonio,

Is there a reason why

“by default, division by zero yields zero”
is not included.

Why is the source code errsysw.prg in FWPPC in folder classes?

Thanks in advance
Otto
User avatar
Antonio Linares
Site Admin
Posts: 44515
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: errsysw - division by zero

Post by Antonio Linares »

Otto,

It is included in errsysw.prg:

Code: Select all | Expand


static function ShowError( oError )

   local cError := oError:Description
   local n
   
   if oError:GenCode == EG_ZERODIV
      return 0
   end

   ...
 

We use just one set of files for both FWH and FWPPC, so in order to have a different errsysw.prg from FWH, we need to place FWPPC one in classes folder.
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Otto
Posts: 7020
Joined: Fri Oct 07, 2005 7:07 pm
Contact:

Re: errsysw - division by zero

Post by Otto »

Hello Antonio,
thank you. Yes you are right. But I don’t understand why if
tisch->menge is 0 the program freezes:
nPreis := tisch->wert / tisch->menge

I use now this code which works:
if tisch->menge <> 0
nPreis := tisch->wert / tisch->menge
endif

Best regards,
Otto
Post Reply