Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
CDataEnv.VCX - cCursor::IsNewAndEmpty()
Message
General information
Forum:
Visual FoxPro
Category:
The Mere Mortals Framework
Title:
CDataEnv.VCX - cCursor::IsNewAndEmpty()
Miscellaneous
Thread ID:
00787093
Message ID:
00787093
Views:
50
is returning a false positive (.T.) when presented with an empty view.
*---------------------------------------------------------
*-- Ensure this object's alias is in the current work area
*---------------------------------------------------------
LOCAL llIsNewAndEmpty, lcFldState

*-------------------------------------------------------------
*-- "3" identifies an appended record that has not been edited
*-------------------------------------------------------------
IF CURSORGETPROP('Buffering') != 1
	lcFldState = This.GetFieldState(-1)
	IF NOT ISNULL(lcFldState)
		llIsNewAndEmpty = lcFldState = REPLICATE('3',LEN(lcFldState))
	ENDIF
ENDIF

RETURN llIsNewAndEmpty
When presented with an empty view lcField state contains the empty string ... REPLICATE('3',LEN(lcFldState)) ... when presented with an empty string ... returns an empty string ... since one empty string returns another ... viola ... llIsNewAndEmpty = .T. when in fact it's quite empty ... but not very new.

This solved my problem nicely ...
IF CURSORGETPROP('Buffering') != 1
	lcFldState = This.GetFieldState(-1)
	IF .NOT. EMPTY( lcFldState ) AND ;
           .NOT. ISNULL(lcFldState)
		llIsNewAndEmpty = (lcFldState = REPLICATE('3',LEN(lcFldState)))
	ENDIF
ENDIF
CTBlankenship, MCP, MCSD
Next
Reply
Map
View

Click here to load this message in the networking platform