Navigation:  Reference > Form Objects > Common Properties >

FldModified

Print this Topic Previous pageReturn to chapter overviewNext page

 

This property will return 1 if the entry text or attached data field has been modified by the user and 0 if it has not been modified.  If the property returns 1 this would generally mean the user has entered data into the object at runtime.

Whenever a record search is executed or a record is saved the FldModified is changed back to 0. This also works with defined fields.

NOTE:  This is a runtime only property and will not show up in the object inspector.  The value of this property would be retrieved using the GET_OBJ_PROP() function.

 

 

NOTE: In the case of the TTASMemo this property works a little differently. Each time the user enters the object, the object makes a copy of what's presently there. Then, if you access this property, the stored version is compared to the current value. If it's different this property returns True, if not, it returns False. When the user enters the object the next time a copy will again be made and that will be compared when this property is checked. Also, when you check this property, if the field has been changed, and there is an attached field (FieldName above other than NONE), that field will be updated at the same time.

 

EXAMPLE

define Fld_Mod type I

Fld_Mod = GET_OBJ_PROP('myobject', 'FldModified')

if fld_Mod > 0

  msg 'The Fld has changed.'

else

msg 'No change'

endif

ret

EXAMPLE 2

In the following example a record has already been saved. Each entry control has a Post procedure like the one below. If the field attached to the control has a changed value, it calls SaveNow1 which will validate the data and save the record without need for user response (a.k.a. Save record?) Each data entry control is bound to a defined field not a database column.

MatActive.post:

ret SaveIfFldModified('MatActive')

func SaveIfFldModified sControlName

define sControlName type A size 30

if get_obj_prop(sControlName,'FldModified') = 0 then ret .T.

// Not modified, don't save

ret

 

 

 


Page url: http://www.cassoftware.com/tas/manual/fldmodified.htm