Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Odd TableUpdate Behaviour
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00088424
Message ID:
00088875
Views:
31
Mark,

In Codebook we have the WriteBuffer() attached to every form that does just what you want. It's called by the Save() method of the form.

José
--------------------------------------------------------------------------------------------
Codebook WriteBuffer() method for cBizObjs forms:
LOCAL llRetval
llRetVal = .T.

*-- Code to save field value to buffer when
*-- clicking on toolbar without leaving the field
*-- Don't do This for a grid since a grid may change
*-- work areas unexpectedly
*-- GETFLDSTATE(0) % 2 will be 0 if GETFLDSTATE(0) returns
*-- a 2 or a 4, indicating that the deletion status has changed
*-- for the current record. No need to flush the buffer if the current
*-- record has been deleted.

* EGL: 8/7/97- Made sure that there is an alias in the current work area.
IF EMPTY(ALIAS())
	RETURN llRetVal
ENDIF	

* EGL: 5/8/97- Added checking for the case where there is no buffering.
IF CURSORGETPROP("BUFFERING") # DB_BUFOFF

	IF GETFLDSTATE(0) % 2 = 1 AND TYPE("This.ActiveControl") == "O" AND ;
	    UPPER(This.ActiveControl.BaseClass) <> "GRID"
	  IF TYPE("This.ActiveControl.ControlSource") <> "U" AND ;
	      !EMPTY(This.ActiveControl.ControlSource)
	    IF EVAL(This.ActiveControl.ControlSource) <> This.ActiveControl.Value
	      REPLACE (This.ActiveControl.ControlSource) WITH This.ActiveControl.Value
	      *-- We rely on the fact that we revert the field's value
	      *-- before This next line of code. 
	      llRetVal = (EVAL(This.ActiveControl.ControlSource) = This.ActiveControl.Value)
	    ENDIF
	  ENDIF
	ENDIF

ENDIF

RETURN llRetVal
Previous
Reply
Map
View

Click here to load this message in the networking platform