Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
site:support.microsoft.com visual foxpro bugs
If that should be the case I should expect this throws an error.
* setinputmask
LOCAL lcAlias, lcField, lcType, laFields[1], ;
lnElement, lnRow, lcIntegerPart, lcDecimalPart
WITH This
IF ! EMPTY( .ControlSource )
IF EMPTY( .InputMask )
*** Only set the inputmask for numeric and character fields
*** and check the data type of the underlying field so we
*** can set it appropriately
lcType = TYPE( This.ControlSource )
IF INLIST( lcType, 'C', 'N' )
*** Parse the alias and the field name from the ControlSource
lcAlias = JUSTSTEM( .ControlSource )
lcField = JUSTEXT ( .ControlSource )
*** Don't attempt to check the properties of the underlying
*** field if we are bound to a form property
IF UPPER( lcAlias ) # 'THISFORM'
*** format the field if it is character
IF lcType = 'C'
.InputMask = REPLICATE( 'X', FSIZE( lcField, lcAlias ) )
ELSE
AFIELDS(laFields, lcAlias)
lnElement = ASCAN(laFields, UPPER(lcField))
IF lnElement > 0
lnRow = ASUBSCRIPT(laFields, lnElement, 1)
lcIntegerPart = REPLICATE('9', laFields[lnRow, 3] - laFields[lnRow, 4] - 1)
lcDecimalPart = REPLICATE('9', laFields[lnRow, 4])
.InputMask = lcIntegerPart + '.' + lcDecimalPart
ENDIF
ENDIF
ENDIF
ENDIF
ENDIF
ENDIF
ENDWITH
This.Value = Alltrim(This.Value)
Return dodefault()
* _ObjectProperties
LPARAMETERS tForm, tObject
LOCAL lcAlias, lcType, lnBufferMode, lnFieldState, lNewRecord, luOldValue,i
lcAlias = ""
lcType = ""
lnBufferMode = 0
lnFieldState = 0
lNeRewcord = .F.
WITH tObject
IF VARTYPE(tForm)="O"
IF PEMSTATUS(tForm,'lNewRecord',5)
lNewRecord = tForm.lNewRecord
ENDIF
ENDIF
IF !EMPTY(.ControlSource) AND ! 'THISFORM' $ UPPER(.ControlSource)
** remove leading spaces
IF TYPE( .ControlSource )=="C"
*Undermentioned code is disabled; although fldstate will be reset this causes requery of teh view to fail
* .Value = ALLTRIM(.Value)
ENDIF
IF '.' $(.ControlSource)
lcAlias = JUSTSTEM(.ControlSource)
ENDIF
lcFieldName = JUSTEXT(.ControlSource)
IF !EMPTY(lcAlias)
lnSelect = SELECT()
SELECT (lcAlias)
lnBuffermode = CURSORGETPROP("Buffering")
IF lnBuffermode > 1
lnFieldState = GETFLDSTATE(lcFieldName,lcAlias)
luOldValue = CURVAL(lcFieldName, lcAlias)
ENDIF
SELECT (lnSelect)
ELSE
lnBuffermode = CURSORGETPROP("Buffering",lcAlias)
lnFieldState = GETFLDSTATE(lcFieldName)
luOldValue = CURVAL(lcFieldName)
ENDIF
ENDIF
DO CASE
CASE lnBufferMode > 1 AND !lNewRecord AND !EMPTY(lcAlias) AND (ALLTRIM(TRANSFORM(luOldValue)) == ALLTRIM(TRANSFORM(.Value))) AND (lnFieldstate = 2 OR lnFieldstate = 4)
SETFLDSTATE(lcFieldName,ICASE(lnFieldState=4,3,lnFieldState=2,1),lcAlias)
CASE lnBufferMode > 1 AND !lNewRecord AND EMPTY(lcAlias) AND (ALLTRIM(TRANSFORM(luOldValue)) == ALLTRIM(TRANSFORM(.Value))) AND (lnFieldstate = 2 OR lnFieldstate = 4)
SETFLDSTATE(lcFieldName,ICASE(lnFieldState=4,3,lnFieldState=2,1))
ENDCASE
ENDIF
ENDWITH
RETURN
*!* 1 Field has not been modified or deletion status has not change
*!* 2 Field has been modified or deletion status has changed.
*!* 3 Field in an appended record has not been modified or deletion status has not changed for the appended record.
*!* 4 Field in an appended record has been modified or deletion status has changed for the appended record.