Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Defensive programming...
Message
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Defensive programming...
Miscellaneous
Thread ID:
00665394
Message ID:
00665394
Views:
47
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
Next
Reply
Map
View

Click here to load this message in the networking platform