Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Numeric Overflow
Message
 
To
19/02/2015 13:53:49
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01615591
Message ID:
01615594
Views:
67
>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform