Hi Scott,

I want to get a  "fire" -event if an attribute, such as 'balance, is
changed. So I can test of a valid data-type or to test wether the new value
is in a valid range.

Additional, I want to prevent someone from changing the 'withdraw or
'deposit functions.

And my next question is, how can I define private attributes in an object?
(like in Java)

-helmut



-----Ursprüngliche Nachricht-----
Von: GS Jones <[EMAIL PROTECTED]>
An: [EMAIL PROTECTED] <[EMAIL PROTECTED]>
Datum: Montag, 29. Januar 2001 21:39
Betreff: [REBOL] Re: object/property1: "new value"


>Hi Helmut,
>
>Elan seems to have answered your first question that pertains to protecting
>attributes in objects.
>
>I am not sure that I fully understand what you are asking in your second
>question:
>...
>> > 2) how can I get an event, when an object variable is changed?
>...
>
>Maybe an example will help.  Here is an object with attributes and
functions
>taken from:
>http://www.rebol.com/rebolsteps.html
>
>account: make object! [
>  name: "Flintstone"
>  balance: $100
>  ss-number: #1234-XX-4321
>  deposit:  func [amount] [balance: balance + amount]
>  withdraw: func [amount] [balance: balance - amount]
>]
>
>Are you asking how to "fire" an event if an attribute, such as 'balance, is
>changed?  Or are you asking how to get and set the attribute?  Or are you
>asking something else entirely?
>
>--Scott
>
>--
>To unsubscribe from this list, please send an email to
>[EMAIL PROTECTED] with "unsubscribe" in the
>subject, without the quotes.
>

-- 
To unsubscribe from this list, please send an email to
[EMAIL PROTECTED] with "unsubscribe" in the 
subject, without the quotes.

Reply via email to