Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Catch not Firing
Message
De
18/04/2003 15:27:38
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Problèmes
Divers
Thread ID:
00779148
Message ID:
00779305
Vues:
14
Well I guess that is the question then. Why isn't the ERASE not generating an error? It fails to erase the file because the file is in use by another user. When I run the program on my Win3k machine the ERASE does generate an error as I would expect.


>>
>>      try
>>         erase (lcSecondDoc)
>>         if file(lcSecondDoc)
>>            wait window 'Erase clearly failed because the file still exist! Catch should fire.'
>>         endif
>>      catch
>>         wait window 'Document in use'
>>         .ActiveDocument.close(0)
>>         .application.quit
>>         oWord = .null.
>>         release oWord
>>         llReturn = .t.
>>      endtry
>>
>
>Robert,
>
>The CATCH in this case is not firing because no error has occurred (according to Fox). Move your ERASE out of the TRY/CATCH and you will see that no error is generated. The ERASE command does not generate errors. If you want to catch an error for this, you could put an ERROR command or THROW command where your WAIT WINDOW is.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform