Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Comparing Try/Catch
Message
 
À
03/03/2004 12:58:24
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00882793
Message ID:
00882844
Vues:
18
>Hi Nick,
>
>Thought I would start a new thread.
>
>>>>I just used RETRY recently in VFP 8 app. :) There I need to make a certain number of retries to open the file that can be under another process at the moment, and cannot yet be opened. I used a combination of ON ERROR and TRY/CATCH.
>>>
>>>Try/Catch in a loop would be alot more elegant than using Retry and On Error.
>>
>>It's a question of how you look at it. :) To me, since the global ON ERROR handler already existed, simple RETRY looked more elegant then bulky construction of a loop with TRY/CATCH.
>>And it does the job. :)
>
>But with ON ERROR the code that contains your RETRY will be in a function altogether different from the function you're writing. You're decoupling all of the exception code from your function code which only makes following the program more difficult, a cost with no thinkable benefits.
>
>As an excersize in understanding exception handling, perhaps you wouldn't mind posting your code with RETRY? We'll adapt it to try/catch for analysis?

Sure, let me just prepare some stuff...
Nick Neklioudov
Universal Thread Consultant
3 times Microsoft MVP - Visual FoxPro

"I have not failed. I've just found 10,000 ways that don't work." - Thomas Edison
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform