Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Defensive programming...
Message
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Defensive programming...
Divers
Thread ID:
00665394
Message ID:
00665394
Vues:
45
Hi - I am trying to understand a bit more about defensive programming! I have this in a procedure...
procedure SetDataEnvironment
if !file(oApp.SysDataBaseLong) then && return false if file doesn't exist
	return .f.
endif
if !dbused("'" + (oApp.SysDataBaseLong) + "'")
	open database (oApp.SysDataBaseLong) shared
	set database to (oApp.SysDataBaseShort)
	set date british
	set exclusive off
	set multilocks on
	set exact on
	return .t.
endif
endproc
I call this in the load of every form just before I open views etc - if the call fails I want to cancel the load of the form and ask the user if they want to try again but I can't seem to cancel out of the load - it seems to run it's course regardless! Any ideas?

Also any general pointers in the area of checking for lost connections to data etc? ie. Lost network connection. What is considered normal practice?

Many thanks

Chris
Chris Maiden
Email
Web
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform