Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
CDataEnv.VCX - cCursor::IsNewAndEmpty()
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
The Mere Mortals Framework
Titre:
CDataEnv.VCX - cCursor::IsNewAndEmpty()
Divers
Thread ID:
00787093
Message ID:
00787093
Vues:
55
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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform