Mombu the Programming Forum

Go Back   Mombu the Programming Forum > Programming > EG_ZERODIV and Dynamic Memory Problems
User Name
Password
REGISTER NOW! Mark Forums Read




Reply Bookmark and Share
1 11th November 11:37
phil mcguinness
External User
 
Posts: 1
Default EG_ZERODIV and Dynamic Memory Problems



Mike,

snip[ Does anyone know of a workaround or patch for this problem? ]

What we do is have a SherlockErrorHandler() and in this .. we trap division
by ZERO
We have done this all the way back through our Clipper applications as well.

PROCEDURE ERRORSYS() AS VOID PASCAL _INIT2
//d Replaced the VO standard errorhandling with our errorhandler
ErrorBlock( {|oError| SherlockErrorHandler(oError)} ) // Routing to our
ErrorHandler

RETURN

------------ snip -----------
// 5
IF (oError:GenCode == EG_ZERODIV )
RETURN 0
ENDIF

--
Phil McGuinness - Sherlock Software
  Reply With Quote


 


2 11th November 11:37
mike jones
External User
 
Posts: 1
Default EG_ZERODIV and Dynamic Memory Problems



Phil,

Yeah, that's pretty much what ours is doing. Have you encountered any
dynamic memory problems as a result of this code being executed in 2.5b3 or
2.6?

Mike
  Reply With Quote
3 11th November 11:37
phil mcguinness
External User
 
Posts: 1
Default EG_ZERODIV and Dynamic Memory Problems


snip[ dynamic memory problems ]

Nah... but hopefully I have NO division by zero errors to process. <G>

Phil McGuinness - Sherlock Software
---
  Reply With Quote
4 11th November 11:37
mike jones
External User
 
Posts: 1
Default EG_ZERODIV and Dynamic Memory Problems


Phil,

You can check whether this problem exists with this simple test program,
using the standard error handler:

FUNCTION Start

LOCAL result AS FLOAT
LOCAL fred AS ARRAY
LOCAL i AS DWORD

BEGIN SEQUENCE

result := 3.2/0.0

END SEQUENCE

FOR i := 1 UPTO 1000
CollectForced()
fred := ArrayCreate(50000)
? DynInfoSize()
NEXT

Run this program twice. On the first run hit "Cancel" when the error box
pops up as a result of the divide by zero. The error handler will break and
the program resumes after the end sequence. You will see that the dynamic
memory remains constant each time through the loop. On the second run, hit
"Ignore" when the error box appears. This causes the error handler to return
0 which is assigned to the result variable. Now on each loop the dynamic
memory usage increases until the program crashes. i.e. returning from the
error handler without breaking seems to have broken the garbage collector.

Mike
  Reply With Quote
Reply


Thread Tools
Display Modes


Some other forums that might be of your interest : Development, Ada, Apple script, Assembler, Awk, Beos, Basic, C, C++, C#, C# .net, .net, .net frameworks, Asp .net, Clarion, Clipper, Clos, Clu, Cobol, Coldfusion, Delphi, Dylan, Eiffel, Forth, Fortran, Haskell, Hermes, Icon, Idl, Java, Java script, Jscript .net, Jcl, Linoleum, Lisp, Lotus, Limbo, Logo, Ml, Mumps, Oberon, Postscript, Pop, Pl1, Prolog, Python, Ruby, Pascal, Perl, Php, Rebol, Rexx, Sed, Sather, Scheme, Smalltalk, Tcl, Vhdl, Vrml, Visual basic, Visual basic .net, Yorick, Mysql, Omnis, Postgresql, Xbase, Access, Oracle, Adabas, Berkeley, Btrieve, Filemaker, Gupta, Db2, Informix, Ingres, Mssql server, Object, Olap, Paradox, Rdb, Revelation, Sybase, Theory, Dbase, Html, Java script, Css, Flash, Photoshop, Corel script, Xml, Tech, Beos, Gem, Hp48, Hpux, Linux, Mac, Ms-dos, Os2, Palm, Solaris, Ti99, Windows, Xenix, Aos, Chorus, Geos, Inferno, Lantastic, Lynx, Mach, Minix, Netware, Os9, Parix, Plan9, Psos, Qnx, Xinu, Sco, Unix, Aix, Aux, 386bsd, Bsdi, Freebsd, Netbsd, Openbsd, Ultrix, Amd, Intel, Aptiva, Buz, Deals, Homebuilt, Overclocking, Programming, Extra forums


Copyright © 2006 SmartyDevil.com - Dies Mies Jeschet Boenedoesef Douvema Enitemaus -
666