Alaska Software Inc. - Divide by zero error
Username: Password:
AuthorTopic: Divide by zero error
Tom UnderwoodDivide by zero error
on Thu, 05 Jul 2012 12:29:30 +1200
I am getting an error when I divide by zero which I did not previously get.

The following code solves it so I am sure divide by zero is the problem.
e.g. x := DivZero( y, z )

*-------------------------------------------------------------------------------
FUNCTION DivZero( nNumerator, nDenominator )
*-------------------------------------------------------------------------------
LOCAL nResult := 0

IF Abs( nDenominator ) > 0
    nResult := nNumerator / nDenominator
END

RETURN nResult

If I use x := y / z and z is zero I get;

FATAL ERROR LOG
Stack Overflow
SYS Thread-ID: 552
Module: EH
Error Codes: EH: 12 Sub: 0(0) OS: 0 XPP: 16
Call Stack of Thread 1 (552):
AUGE_ OHRRe: Divide by zero error
on Thu, 05 Jul 2012 06:29:52 +0200
hi,

>I am getting an error when I divide by zero which I did not previously get.

did you change PC 
which 32/64bit OS()  and which Xbase++ Version ?

greetings by OHR
Jimmy
Tom UnderwoodRe: Divide by zero error
on Thu, 05 Jul 2012 17:33:13 +1200
I am using 64 bit Win 7
Clients are a mixture of terminal services on Server 2008 64 bit, Win XP 32 
bit, Win 7 32 bit and Win 7 64 bit.

"AUGE_ OHR" wrote in message 
news:2d1c8f0b$38a36477$1f3e3@news.alaska-software.com...

hi,

>I am getting an error when I divide by zero which I did not previously get.

did you change PC 
which 32/64bit OS()  and which Xbase++ Version ?

greetings by OHR
Jimmy
AUGE_ OHRRe: Divide by zero error
on Thu, 05 Jul 2012 19:00:50 +0200
hi,

>I am using 64 bit Win 7

PDR 6286 /  6130

greetings by OHR
Jimmy
Tom UnderwoodRe: Divide by zero error
on Thu, 05 Jul 2012 17:34:48 +1200
Version 1.90.355

"AUGE_ OHR" wrote in message 
news:2d1c8f0b$38a36477$1f3e3@news.alaska-software.com...

hi,

>I am getting an error when I divide by zero which I did not previously get.

did you change PC 
which 32/64bit OS()  and which Xbase++ Version ?

greetings by OHR
Jimmy
AUGE_ OHRRe: Divide by zero error
on Fri, 06 Jul 2012 02:09:30 +0200
hi,

>Version 1.90.355

as i say these PDR point to Hotfix 36

greetings by OHR
Jimmy
Tom UnderwoodRe: Divide by zero error
on Sat, 27 Oct 2012 07:33:38 +1300
I have applied Hotfix 36 (xpprt1.dll) it doesn't help



"AUGE_ OHR" wrote in message 
news:f35e935$608c5c3c$21b9e@news.alaska-software.com...

hi,

>Version 1.90.355

as i say these PDR point to Hotfix 36

greetings by OHR
Jimmy
AUGE_ OHRRe: Divide by zero error
on Thu, 15 Nov 2012 00:14:23 +0100
hi,

>I have applied Hotfix 36 (xpprt1.dll) it doesn't help

    FIX 109-6130 Division by zero wrong on Windows 64 Bit
    FIX 109-6290 Wrong parameters in application started in debugger (Win 7)
    FIX 109-6250 DllUnload requires a timeframe of 300 milliseconds
    FIX 109-6286 On 64 Bit operating systems division by zero not correct
    FIX 109-6295 Error "Invalid numeric value" after call to COM/AcitveX

hm ... try XPPLOAD if you real "loading" that XppRt1.dll ?

greetings by OHR
Jimmy
Tom UnderwoodRe: Divide by zero error
on Mon, 21 Jan 2013 14:50:20 +1300
XppRt1.dll,    2010-06-21 11:25:42,  1860096, 1.90.355,e:\ccpm\,V

"AUGE_ OHR" wrote in message 
news:370ece74$165d3cff$7256@news.alaska-software.com...

hi,

>I have applied Hotfix 36 (xpprt1.dll) it doesn't help

    FIX 109-6130 Division by zero wrong on Windows 64 Bit
    FIX 109-6290 Wrong parameters in application started in debugger (Win 7)
    FIX 109-6250 DllUnload requires a timeframe of 300 milliseconds
    FIX 109-6286 On 64 Bit operating systems division by zero not correct
    FIX 109-6295 Error "Invalid numeric value" after call to COM/AcitveX

hm ... try XPPLOAD if you real "loading" that XppRt1.dll ?

greetings by OHR
Jimmy
Tom UnderwoodRe: Divide by zero error
on Sat, 27 Oct 2012 07:43:18 +1300
This is the log entry

FATAL ERROR LOG
Stack Overflow
SYS Thread-ID: 492
Module: EH
Error Codes: EH: 12 Sub: 0(0) OS: 0 XPP: 16
Call Stack of Thread 1 (492):
PRODEDGE(231)
FAVOURITE(134)
(B)MetroMenu(327)
METROMENU(545)
MAIN(95)
Call Stack of GUI Thread (704):
File: e:\ccpm\CLEARCUT.EXE
TimeStamp: 20121027 07:15
End of FATAL ERROR LOG.

"AUGE_ OHR" wrote in message 
news:f35e935$608c5c3c$21b9e@news.alaska-software.com...

hi,

>Version 1.90.355

as i say these PDR point to Hotfix 36

greetings by OHR
Jimmy
James LoughnerRe: Divide by zero error
on Fri, 26 Oct 2012 15:31:08 -0400
Are you using a custom error handler?

Jim

On 10/26/2012 02:43 PM, Tom Underwood wrote:
> This is the log entry
>
> FATAL ERROR LOG
> Stack Overflow
> SYS Thread-ID: 492
> Module: EH
> Error Codes: EH: 12 Sub: 0(0) OS: 0 XPP: 16
> Call Stack of Thread 1 (492):
> PRODEDGE(231)
> FAVOURITE(134)
> (B)MetroMenu(327)
> METROMENU(545)
> MAIN(95)
> Call Stack of GUI Thread (704):
> File: e:\ccpm\CLEARCUT.EXE
> TimeStamp: 20121027 07:15
> End of FATAL ERROR LOG.
>
> "AUGE_ OHR" wrote in message
> news:f35e935$608c5c3c$21b9e@news.alaska-software.com...
>
> hi,
>
>> Version 1.90.355
>
> as i say these PDR point to Hotfix 36
>
> greetings by OHR
> Jimmy
Tom UnderwoodRe: Divide by zero error
on Mon, 05 Nov 2012 16:56:25 +1300
I didn't think so, I will check that out now.

"James Loughner" wrote in message 
news:7d6b2499$53b189f3$2c25@news.alaska-software.com...

Are you using a custom error handler?

Jim

On 10/26/2012 02:43 PM, Tom Underwood wrote:
> This is the log entry
>
> FATAL ERROR LOG
> Stack Overflow
> SYS Thread-ID: 492
> Module: EH
> Error Codes: EH: 12 Sub: 0(0) OS: 0 XPP: 16
> Call Stack of Thread 1 (492):
> PRODEDGE(231)
> FAVOURITE(134)
> (B)MetroMenu(327)
> METROMENU(545)
> MAIN(95)
> Call Stack of GUI Thread (704):
> File: e:\ccpm\CLEARCUT.EXE
> TimeStamp: 20121027 07:15
> End of FATAL ERROR LOG.
>
> "AUGE_ OHR" wrote in message
> news:f35e935$608c5c3c$21b9e@news.alaska-software.com...
>
> hi,
>
>> Version 1.90.355
>
> as i say these PDR point to Hotfix 36
>
> greetings by OHR
> Jimmy
Tom UnderwoodRe: Divide by zero error
on Thu, 15 Nov 2012 10:56:28 +1300
My 32 bit W7 works OK, 64 bit causes the fatal error.

I have tried it with a copy of errorsys.prg from c:\alaska\xppw32\source\sys 
and with no errorsys.prg (which should use the one from XPPSYS.DLL)
I added a line to errorsys.prg and tested this with a deliberate missing 
variable i.e.

***********************************
* Install default error code block
***********************************
PROCEDURE ErrorSys()
   ErrorBlock( {|o| StandardEH(o)} )
RETURN



*************************************
* Default error handler function
*************************************
STATIC FUNCTION StandardEH( oError )
   LOCAL i, cMessage, aOptions, nOption, nSeverity
   LOCAL row, col
   LOCAL oDacSession, oSession

Alert( "In errorsys" )

   /* Check if error is handled automatically */
   DO CASE

   /* Division by zero results in 0 */
   CASE oError:genCode == XPP_ERR_ZERODIV
      RETURN 0

The divide by zero error does not display the alert, so it doesn't get to 
the error handler.

"Tom Underwood" wrote in message 
news:c480849$396ea496$578a1@news.alaska-software.com...

I didn't think so, I will check that out now.

"James Loughner" wrote in message
news:7d6b2499$53b189f3$2c25@news.alaska-software.com...

Are you using a custom error handler?

Jim

On 10/26/2012 02:43 PM, Tom Underwood wrote:
> This is the log entry
>
> FATAL ERROR LOG
> Stack Overflow
> SYS Thread-ID: 492
> Module: EH
> Error Codes: EH: 12 Sub: 0(0) OS: 0 XPP: 16
> Call Stack of Thread 1 (492):
> PRODEDGE(231)
> FAVOURITE(134)
> (B)MetroMenu(327)
> METROMENU(545)
> MAIN(95)
> Call Stack of GUI Thread (704):
> File: e:\ccpm\CLEARCUT.EXE
> TimeStamp: 20121027 07:15
> End of FATAL ERROR LOG.
>
> "AUGE_ OHR" wrote in message
> news:f35e935$608c5c3c$21b9e@news.alaska-software.com...
>
> hi,
>
>> Version 1.90.355
>
> as i say these PDR point to Hotfix 36
>
> greetings by OHR
> Jimmy