Re: FP: Trapping division by zero (Error 1307)

2014-02-19 Thread Fred Krampe
.   Thanks to everyone who contributed. From: Man-wai Chang changmw at gmail.com To: ProFox Email List profox at leafe.com Sent: Monday, 12 August 2013, 15:27 Subject: Re: FP: Trapping division by zero (Error 1307) This is my Foxpro/DOS way of catching division

Re: FP: Trapping division by zero (Error 1307)

2013-08-16 Thread Man-wai Chang
I noticed that the original question involved the use of EVALUATE(). Maybe the stuff inside EVALUATE() was wrong. On Fri, Aug 16, 2013 at 2:17 AM, Gene Wirchenko ge...@telus.net wrote: I tried select 1/0 from ccli (ccli being a table in my app) and no error was thrown. I

Re: FP: Trapping division by zero (Error 1307)

2013-08-16 Thread Laurie Alvey
The original contained something like this: lcExpr = 1/0 ? EVALUATE(lcExpr) From: Man-wai Chang chan...@gmail.com To: ProFox Email List profox@leafe.com Sent: Friday, 16 August 2013, 11:17 Subject: Re: FP: Trapping division by zero (Error 1307) I noticed

RE: FP: Trapping division by zero (Error 1307)

2013-08-15 Thread Gene Wirchenko
At 08:59 2013-08-12, Allen pro...@gatwicksoftware.com wrote: Not so, I have a select that fell over with div/0 and an on error dealt with that. I tried select 1/0 from ccli (ccli being a table in my app) and no error was thrown. I got a cursor of 620 row of asterisks. I

Re: FP: Trapping division by zero (Error 1307)

2013-08-13 Thread L ALVEY
. From: Man-wai Chang chan...@gmail.com To: ProFox Email List profox@leafe.com Sent: Monday, 12 August 2013, 15:27 Subject: Re: FP: Trapping division by zero (Error 1307) This is my Foxpro/DOS way of catching division by zero: on error * x=1/0 if if *$x     ? x     ? divide

FP: Trapping division by zero (Error 1307)

2013-08-12 Thread L ALVEY
It seems that division by zero is not caught by VFP. In the command window, type ? 1/0 return, and you get a line of asterisks, right? (I'm running VFP9 SP2.)   I have a form which evaluates a string expression and sends the result back to its caller. The only way I have found to catch division

Re: FP: Trapping division by zero (Error 1307)

2013-08-12 Thread Alan Bourke
On Mon, Aug 12, 2013, at 10:18 AM, L ALVEY wrote: I think it wrong that VFP does not catch this error natively, unless I've missed a SET command or SYS() function. Well, it has ever been thus, and probably remained thus because that's how dBase worked back in the mists of time. I have to say

Re: FP: Trapping division by zero (Error 1307)

2013-08-12 Thread Man-wai Chang
If TRY... CATCH doesn't work, you could always use the good old ON ERROR. On Mon, Aug 12, 2013 at 5:18 PM, L ALVEY truk...@btinternet.com wrote: It seems that division by zero is not caught by VFP. In the command window, type ? 1/0 return, and you get a line of asterisks, right? (I'm running

Re: FP: Trapping division by zero (Error 1307)

2013-08-12 Thread L ALVEY
ON ERROR doesn't work either.   Laurie Alvey From: Man-wai Chang chan...@gmail.com To: ProFox Email List profox@leafe.com Sent: Monday, 12 August 2013, 13:42 Subject: Re: FP: Trapping division by zero (Error 1307) If TRY... CATCH doesn't work, you could always

Re: FP: Trapping division by zero (Error 1307)

2013-08-12 Thread Alan Bourke
On Mon, Aug 12, 2013, at 02:21 PM, L ALVEY wrote: ON ERROR doesn't work either. No, it's not regarded as an error or exception so the only thing that you can do is check in code before doing a division where there's a chance the divisor will be zero. If you look at how various languages

Re: FP: Trapping division by zero (Error 1307)

2013-08-12 Thread Alan Bourke
In fact the only time that any version of FoxPro has ever produced a divide by zero error is back in the days of FoxPro for Windows, when processors got so fast that the code it used internally to calculate the speed would fail. Some enterprising hacker then hacked the support library to stop it

Re: FP: Trapping division by zero (Error 1307)

2013-08-12 Thread Man-wai Chang
Not even ON ERROR *??? Now that's weird From FOXHELP.CHM: ON ERROR DO errhand WITH ; ERROR( ), MESSAGE( ), MESSAGE(1), PROGRAM( ), LINENO( ) *** The next line should cause an error *** USE nodatabase ON ERROR restore system error handler PROCEDURE errhand PARAMETER merror, mess, mess1,

Re: FP: Trapping division by zero (Error 1307)

2013-08-12 Thread Man-wai Chang
This is my Foxpro/DOS way of catching division by zero: on error * x=1/0 if if *$x ? x ? divide by zero endif on error -- .~. Might, Courage, Vision. SINCERITY! / v \ 64-bit Ubuntu 9.10 (Linux kernel 2.6.39.3) /( _ )\ http://sites.google.com/site/changmw ^ ^ May the Force and farces be

RE: FP: Trapping division by zero (Error 1307)

2013-08-12 Thread Allen
Not so, I have a select that fell over with div/0 and an on error dealt with that. Al -Original Message- From: ProfoxTech [mailto:profoxtech-boun...@leafe.com] On Behalf Of Alan Bourke Sent: 12 August 2013 15:28 To: profoxt...@leafe.com Subject: Re: FP: Trapping division by zero (Error