realbasic-nug
[Top] [All Lists]

Re: Scope/Protection Question

To: REALbasic NUG <realbasic-nug@lists.realsoftware.com>
Subject: Re: Scope/Protection Question
From: Karen <keatk@verizon.net>
Date: Sat, 30 May 2009 02:16:31 -0400
Authentication-results: mx.google.com; spf=neutral (google.com: 74.124.194.228 is neither permitted nor denied by domain of realbasic-nug-bounces@lists.realsoftware.com) smtp.mail=realbasic-nug-bounces@lists.realsoftware.com
Delivered-to: listarchive@realsoftware.com
In-reply-to: <345AFE42-338C-4588-9F76-7560C88B8609@verizon.net>
References: <345AFE42-338C-4588-9F76-7560C88B8609@verizon.net>
Reply-to: REALbasic NUG <realbasic-nug@lists.realsoftware.com>
Sender: realbasic-nug-bounces@lists.realsoftware.com
I missed some relevant info

That should have read


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 a method:

Sub Class1.aMethod(Parent as Class2)
  me.Property1 = Parent.Property1
End Sub

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


BTW if I change the method To
Sub Class1.aMethod(Parent as Class1)
  me.Property1 = Parent.Property1
End Sub

All works as expected!

Thanks,
- Karen


_______________________________________________
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>