************************************************** *-- Class: chkcharacter *-- Check box class used to bind to character data - such as a field that takes values Y/N * Define Class chkcharacter As checkbox Caption = "" Value = .F. *-- the character to use when the box is checked ctruevalue = "Y" *-- The character to use when the box is unchecked cfalsevalue = "N" *-- The character data source for this control ccontrolsource = "" Name = "chkcharacter" *-- Called from the valid top manually update the character data from the logical value Procedure updatecontrolsource Local llValue, lcField, lcAlias, lcValue llValue = This.Value lcValue = Iif( This.Value, This.ctruevalue, This.cfalsevalue ) lcField = Justext( This.ccontrolsource ) lcAlias = Juststem( This.ccontrolsource ) *** Update cControlSource from the Control's Value *** Check to see if we are updating a form property If Upper( Left( This.ccontrolsource, 4 ) ) == 'THIS' lcControlSource = This.ccontrolsource &lcControlSource = lcValue Else Replace ( lcField ) With lcValue In ( lcAlias ) Endif Endproc *-- Called from the refresh to manually update the logical value from character data Procedure refreshvalue Local lcValue lcValue = Nvl( Evaluate( This.ccontrolsource ), '' ) *** Update the control's value from its cControlSource This.Value = Iif( Left( lcValue, 1 ) == This.ctruevalue, .T., .F. ) Endproc Procedure Refresh This.refreshvalue() DoDefault() Endproc Procedure Valid This.updatecontrolsource() Endproc Procedure Init This.refreshvalue() Endproc Enddefine