On May 13, 2006, at 3:07 PM, Tony Cerrato wrote:
Hello,
I am feeling like an idiot. What syntax do I use inside of a Get
and Set method of a Computed Property?
If I wish to have a computed property (e.g., of type integer), that
does nothing more than mimic a "normal" property, what code do I
put inside the Get and Set methods?
Whatever code you need to get and set the value. For example,
suppose you have a computed property EntryDate as Date. Add a
private property EntryDateTotalSeconds as Double. Then implement the
handlers as follows.
Sub Set(value as Date)
If value is nil then
//handle as you see fit
Else
me.EntryDateTotalSeconds = value.TotalSeconds
End if
End Sub
Function Get() as Date
dim d as new Date
d.TotalSeconds = me.EntryDateTotalSeconds
Return d
End Function
Charles Yeomans
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>