Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Tratamento de erro no Fox!
Message
De
27/06/2003 09:43:29
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00804642
Message ID:
00804653
Vues:
36
>Gostaria de saber como tratar um erro no foxpro...
>Estou com o erro de file access denied pois a tabela ja está aberta e preciso abrir ela no modo exclusivo e se alguem tiver usando eu digo que não da pra atualizar nakele momento sacou...
>queria tratar esse erro.
>Valeu pessoal!

Algo assim:
local llError, lcError
lcError = on("error") && guardar antigo ON ERROR
on error llError = .T.
use MinhaTabela exclusive  && Se houvesse error, llError = .T.
if llError
  MessageBox("Nao posso abrir")
else
  * Processar tabela
endif
on error &lcError  && Restaurar antigo ON ERROR
Em VFP8 tem TRY...CATCH, que é melhor. Veja os artículos em Universal Thread Magazine.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform