Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Numerical overflow
Message
 
 
To
06/03/2002 16:20:37
Lutz Scheffler
Lutz Scheffler Software Ingenieurbüro
Dresden, Germany
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00628980
Message ID:
00629262
Views:
17
>Hi Nady,
>your
>>
>>LOCAL;
>>llErr
>>
>>llErr = .f.
>>create cursor murks (nField n(1), nField1 n(3), cField C(20))
>>ON ERROR do myError with error() && llErr=.T.
>>nField = 100
>>nField1 = 100
>>cField = 'Nadya'
>>append blank
>>*insert into murks from memvar &&(nField) values (100)
>>gather memvar
>>
>>*-----------------
>>function myError
>>lparameter tnErrorNum
>>if m.tnErrorNum = 39 && Numeric overflow
>>   local lnFields, lnI, lcAlias
>>   lnFields = afields(laFields) && assuming the table is opened
>>   lcAlias = alias()
>>   for lnI=1 to m.lnFields
>>       if laFields[m.lnI,2]='N' and ;
>>       "*" $ transform(evaluate(lcAlias+"."+laFields[m.lnI,1])) && This is a field, which gave an error
>>           =messagebox('Field '+ laFields[m.lnI,1]+" would be blanked because of numeric overflow")
>>           blank field (laFields[m.lnI,1])
>>           exit
>>       endif
>>   next
>>   return
>>endif
>look like a goog idea. My suggestion to it would be to avoid exit - you may have more than one overflow.
>
>Agnes

Right, I thought about it too. Another idea from George: add check for all possible numerical types, e.g. I, B, F, Y.

Anyway, this is just an idea. Now I'm thinking: should we include it into our main Error Handler or should I go right ahead and add it to my particular application. The later solution looks like more flexible, since I would have an ability to count for number of such errors per file and if it would rich a critical point, I would stop the process...
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform