Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Numeric Overflow
Message
 
À
19/02/2015 13:53:49
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01615591
Message ID:
01615594
Vues:
60
>As a result of some processing I am getting a field with a value of ************* (numeric overflow)
>
>I'm not at all concerned (yet) with why this is happening (I'll fix that problem later).
>
>I want to do something like
>REPLACE field1 WITH IIF(field2 is numberic overflow, value1, value2)
>
>What expression can I use to determine when field2 is at numeric overflow
>
>Thanks to all................Rich

You can do something like this:
TRY
	REPLACE field1 WITH value2
CATCH TO loException WHEN loException.ErrorNo = 39
	REPLACE field1 WITH value1
ENDTRY
Can't think of a one-liner, also note that any other error will be raised normally

[Update]I updated the code a little bit to better reflect your case[/Update]
"The five senses obstruct or deform the apprehension of reality."
Jorge L. Borges?

"Premature optimization is the root of all evil in programming."
Donald Knuth, repeating C. A. R. Hoare

"To die for a religion is easier than to live it absolutely"
Jorge L. Borges
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform