Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
2.6 App on 98/NT/2000 - Bug in Round()?
Message
De
10/11/2000 17:04:27
 
 
À
10/11/2000 16:59:14
Information générale
Forum:
Visual FoxPro
Catégorie:
FoxPro 2.x
Divers
Thread ID:
00440487
Message ID:
00440514
Vues:
19
>>Intro: We finally debugged a legacy FPW 2.6 application (exe running with foxw2600.esl) which was giving us problems on Win98 and Win2000; the cause seems to be 2.6's round() function. I'm sending this email both to notify folks of what we've found and to see if anyone out there has had similar problems…
>>
>>Symptom: The app runs fine on Win95, but on Win98, 2000, and NT it crashes during runtime, often but not always at the same place in the app. The crash is some kind of Fatal Exception Error which (surprise) doesn't shed much light on the problem. On Win98, after restarting the app it works fine (until after the next reboot, that is). On Win2000 and sometimes NT, the app just freezes and has to be terminated with the task manager; restarting the app doesn't help - it just freezes again, making the app unusable on those machines.
>>
>>Solution: We traced the problem to 2.6's round() function, which was being called at each instance of the crash. Removing round() allowed the app to run on all platforms without crashing. (Yes, we've applied the MS patch for 2.6 on fast machines…) We suspect that int() may give the same error, but we haven't yet thoroughly tested this.
>>
>>Has anyone out there had similar problems? Any known solutions other than just avoiding round()? (We've searched the UT extensively, but have not yet gotten into MSDN…)
>>
>>Thanks!
>>
>>- Larry
>
>I haven't heard of any bug with ROUND() under FPW2.x.
>
>Are you by any chance using ROUND() in a SELECT - SQL statement, e.g.
SELECT ;
>  ROUND(MyNumericField, 2) AS MyRoundedValue ;
>  FROM MyTable ;
>  ...
If so, and you have a set of values in MyTable.MyNumericField like
1.2345
>12.3456
>123.4567
then the size of the resulting column will be based on the first value, and may not be large enough to contain results from later in the table. FP may overflow, or you might get something like the crashes you're seeing.

Just to follow up, if the above is your problem, one simple solution is to explicitly specify the desired size of the output column with something like
SELECT ;
  0000.00 + ROUND(MyNumericField, 2) AS MyRoundedValue ;
  FROM MyTable ;
  ...
Regards. Al

"Violence is the last refuge of the incompetent." -- Isaac Asimov
"Never let your sense of morals prevent you from doing what is right." -- Isaac Asimov

Neither a despot, nor a doormat, be

Every app wants to be a database app when it grows up
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform