Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Problem with numeric overflow (again!)
Message
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Divers
Thread ID:
00964813
Message ID:
00964829
Vues:
9
This message has been marked as the solution to the initial question of the thread.
type("m.oError")
Why don't you process error in the CATCH clause? Also in
catch to oError   &&&  when .t. isn't necessary
>I am trying to use try/catch block, but I must be doing something wrong, because I am getting unhandled errors instead. Here is my new code:
>
>*---- Summarizing should be here
>			for i=1 to m.lCount
>				lnSum = evaluate('curtemp.' + sumfields[m.i,1]) + 
evaluate('m.'+sumfields[m.i,1])
>				try
>					replace ('curtemp.' + sumfields[m.i,1]) 
with m.lnSum in curtemp
>					llReplace = .t.
>				catch to oError when .t.
>					=messagebox("Error replacing!" + 
chr(13) + ;
>                  oError.Message + chr(13) + ;
>                  "Error #:"+Transform(oError.ErrorNo)+chr(13)+;
>                  "Line #:"+Transform(oError.LineNo)+chr(13)+;
>                  "Error #:"+Transform(oError.LineContents),48,"Error")
>					llReplace = .f.
>				finally
>					if type(m.oError)="O" and m.oError.ErrorNo = 39 
&& Numeric overflow
>* we need to find maximum allowed for the field and use it instead 
of a sum
>						messagebox("lnSum = " + transform(m.lnSum) + 
" for field " + sumfields[m.i,1])
>					endif
>				endtry
>			endfor
>
>
>which gives me unhandled error 11. How can I solve this problem?
>
>Thanks in advance.
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform