Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Need good practice suggestion
Message
 
 
To
26/10/2008 11:49:37
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Vista
Network:
Windows 2008 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01356528
Message ID:
01357360
Views:
22
>>>I'm not aware of any slowdown caused by TRY...ENDTRY that would warrant not to use it when necessary.
>>>
>>
>>Good to know. Maybe I have read about slow TRY/CATCH on the .NET forum. Thank you for your input.

>
>Yeah, you probably heard it from me on the .NET forum, but I should clarify that perception: there is no performance hit at all, unless there's an error that's caught. My point about where to use try/catch is that it shouldn't be used to catch errors that you can test for some other way. Testing for a potential error beats allowing a try to catch the error, performance-wise ... unless it's something that is unlikely to occur.
>
>At least that's the case in .NET ... I can't remember if it's the same in VFP, but I suspect that it is.
>

That's the way I learned it, too -- that the Catch block should be for things the programmer can't control, such as missing files.
Previous
Reply
Map
View

Click here to load this message in the networking platform