Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
RETRY in TRY-CATCH
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 8 SP1
Miscellaneous
Thread ID:
01295546
Message ID:
01295622
Views:
15
Friday as you said :-) Ans I am almost asleep (BUT I'll found a way :-))))
llRetry = 0
DO WHILE llRetry < 3 && We don't want to loop endlessly here :-)
   TRY
         some code
         IF llRetry == 0 
            lcFile  = MyGetFileRoutine()
         ELSE
            lcFile = MyGetAlternateFileRoutine()
         ENDIF
         USE (lcFile)
  *      more code
         llRetry = 700
   CATCH WHEN 3 && Can not open the file
         llRetry = llRetry + 1
   CATCH
        *** do the normal CATCH programming
        llRetry = 700
   ENDTRY
ENDDO
>Borislav,
>
>Yes, I thought about doing like that, but then... I do not know if myGetFileRoutine depends on "some code", told you it gets ugly <g>
>
>>O, I see what you mean:
>>
>>llRetry = 0
>>lcFile  = MyGetFileRoutine()
>>DO WHILE llRetry < 3 && We don't want to loop endlessly here :-)
>>   TRY
>>         some code
>>         USE (lcFile)
>>  *      more code
>>         llRetry = 700
>>   CATCH WHEN 3 && Can not open the file
>>         lcFile = MyGetAlternateFileRoutine()
>>         llRetry = llRetry + 1
>>   CATCH
>>        *** do the normal CATCH programming
>>        llRetry = 700
>>   ENDTRY
>>ENDDO
>>
>>
>>
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform