On Sep 6, 2006, at 1:06 PM, Arnaud Nicolet wrote:

Le 6 sept. 06 à 19:31 Soir, Robert Poland a écrit:

Hi,

In Class1 I have this statement"w=TextWindow"

When I run it I get the error This property does not exist.

I have w=TextWindow set as a property, Global in TextWindow. I thought that a global property could be accessed from anywhere without a prefix.

This is true for modules.
For classes and windows, global is named public. (at least in my RB version).

Would that be 5.5? You don't see anything in the latest releases.

For example, say you have 2 windows opened (you used w=new win1 twice).

Then how would the compiler knows for which win1
MyWin1Property=2
refers to?

In that case wouldn't 'w' refer to an instance of win1? MyWin1.Property doesn't exist as far as I can see by this code snippet.

One must remember that if one has multiple windows of the same class name opened, 'w' will usually refer to the last one cast with the variable used. You must use other methods to determine which of the win1 windows you are referring to. Here again, the scope of the variable used is important.

REALbasic is really good at showing casting errors most of the time but bad location of these variables can affect the execution of your application.

That seems logical to keep the prefix.

In this case, the class name is useless and it also isn't a prefix. It's the name of the object or objects you are referring to. The variable that is cast to Win1 is the point in question.

All I did was to clarify the scope of the variable "w". There really wasn't enough code to ascertain exactly what was being attempted.

If Robert can provide more detail we might be able to ascertain what he did that was wrong in his code.

Terry


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

Reply via email to