realbasic-nug
[Top] [All Lists]

Re: Scope/Protection Question

To: REALbasic Network Users Group <realbasic-nug@lists.realsoftware.com>
Subject: Re: Scope/Protection Question
From: Maximilian Tyrtania <maximilian.tyrtania@onlinehome.de>
Date: Sat, 30 May 2009 19:48:18 +0200
Authentication-results: mx.google.com; spf=neutral (google.com: 74.124.194.228 is neither permitted nor denied by best guess record for domain of realbasic-nug-bounces@lists.realsoftware.com) smtp.mail=realbasic-nug-bounces@lists.realsoftware.com
Delivered-to: listarchive@realsoftware.com
In-reply-to: <A072D68C-C1A1-4629-AA8D-D9514449DC66@mac.com>
Reply-to: REALbasic NUG <realbasic-nug@lists.realsoftware.com>
Sender: realbasic-nug-bounces@lists.realsoftware.com
Thread-index: AcnhTtCWDwkNZk1CEd6BfAAjMt4/tA==
Thread-topic: Scope/Protection Question
User-agent: Microsoft-Entourage/11.4.0.080122
Hi Tom,

I think you are confusing the protected scope with the private scope.

Best,

Maximilian Tyrtania

am 30.05.2009 16:03 Uhr schrieb Tom Benson unter tombenson@mac.com:

> Hmmm... tricky to explain....
> 
> You can't access that property of the "parent" reference as it is
> protected.
> 
> Just because class2 is a child of class1 doesn't meant hat if you
> store a reference to an instance of class1 in class2 you will be able
> to access that instances protected properties, if that makes any sense.
> 
> Another way to think about protected properties is as follows: you can
> access them only via "me." syntax.
> 
> That is, you can never say objectReference.protectedProperty, as it
> will throw scope errors, which is what you are experiencing here....
> 
> - Tom Benson
> ---------------------------------------------------------------
> Custom Controls & Code Libraries
> for REALbasic version 5.5 and up
> 
> http://www.qedit.com.au
> 
>> Say I have a Class1 that has a PROTECTED property Property1
>> 
>> Class2 Inherits From Class1
>> Class2 Has a property Parent as Class1
>> 
>> In a method on Class1 I have
>> 
>> me.Property1 = Parent.Property1
>> 
>> I thought I should be able to do that as i thought protected
>> properties should be able accessed within the class and it's
>> subclasses
>> 
>> But the compiler said:
>> This property is protected. It can only be used from within its
>> class, isSelectedMy = Parent.isSelectedMy
>> 
>> 
>> I thought I had done that before. Is this a bug or is it just too
>> late at night and I am tired and confused?
>> 
>> RB2009r2.1 Mac OSX 10.4.11 PPC
>> 
>> Thanks,
>> - Karen
> 
> _______________________________________________
> Unsubscribe or switch delivery mode:
> <http://www.realsoftware.com/support/listmanager/>
> 
> Search the archives:
> <http://support.realsoftware.com/listarchives/lists.html>



_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>


<Prev in Thread] Current Thread [Next in Thread>