Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Close Tables
Message
 
To
27/10/2005 05:08:39
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Title:
Environment versions
Visual FoxPro:
VFP 7
OS:
Windows XP SP2
Network:
Novell 4.x
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01062421
Message ID:
01062539
Views:
13
>Boris, where can I shared ? I put all the tables in data environment by using ADD command.
>
>Saif

In load event on every form put:
SET EXCLUSIVE OFF

But there are many SET command that is scoped to current datasession only, that's why I have a class the sets them properly and I just drop it into the form. Here it's code It has a few properties and all it's code is in INIT and DESTROY events:
DEFINE CLASS ChangeDataSessionSettings AS custom


	Height     = 13
	Width      = 24
	Name       = "ChangeDataSessionSettings"
	cpoint     = .F.
	csep       = .F.
	cdate      = .F.
	ccurrency  = .F.
	ctalk      = .F.
	cdeleted   = .F.
	getdeleted = .F.
	csafety    = .F.
	crefresh   = .F.
	cexact     = .F.
	getexact   = .F.
	chours     = .F.
	hour_12    = .F.
	is_sethour = .F.


	PROCEDURE Init
		* Save old settings to be restored.
		THIS.cPoint    = SET("POINT")
		THIS.cSep      = SET("SEPARATOR")
		THIS.cDate     = SET("DATE")
		THIS.cCurrency = SET("CURRENCY", 1)
		THIS.cTalk     = SET("TALK")
		THIS.cDeleted  = SET("DELETED")
		THIS.cSafety   = SET("SAFETY")
		THIS.cRefresh  = SET("REFRESH")
		THIS.cExact    = SET("EXACT")
		this.chours    = SET("Hours")


		SET POINT     TO POINT_LOC
		SET SEPARATOR TO SEP_LOC
		SET DATE      TO DATE_LOC
		SET CURRENCY  TO CURRENCY_LOC
		SET CENTURY   ON
		SET CENTURY   TO 19 ROLLOVER 50
		SET NOTIFY    OFF
		SET ECHO      OFF
		SET DEBUG     OFF

		IF this.is_sethour 
		   IF this.hour_12 
		      SET HOURS TO 12
		   ELSE
		      SET HOURS TO 24
		   ENDIF
		ENDIF

		IF this.GetDeleted
		   SET DELETED ON
		ELSE
		   SET DELETED OFF
		ENDIF

		IF this.GetExact
		   SET EXACT ON
		ELSE
		   SET EXACT OFF
		ENDIF

		SET SAFETY  OFF
		SET TALK    OFF
		SET REFRESH TO 5,5
	ENDPROC

	PROCEDURE Destroy
		LOCAL cMacro
		cMacro = THIS.cTalk
		SET TALK &cMacro
		cMacro = THIS.cDeleted
		SET DELETED &cMacro
		cMacro = THIS.cExact
		SET EXACT &cMacro
		SET POINT TO THIS.cPoint
		SET SEPARATOR TO THIS.cSep
		SET DATE TO (THIS.cDate)
		SET CURRENCY TO THIS.cCurrency
		SET REFRESH TO this.cRefresh
		SET HOURS TO this.chours
	ENDPROC


ENDDEFINE
I borrow this class from Solution samples :-)
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform