Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Tratamento de erro no Fox!
Message
From
27/06/2003 09:43:29
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00804642
Message ID:
00804653
Views:
34
>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)
Previous
Reply
Map
View

Click here to load this message in the networking platform