Hint: worksheets(1) is actually short for worksheets.Item(1) with the Item property being the default property.
Hint: worksheets(1) is actually short for worksheets.Item(1) with the Item property being the default property.
Everyone who confuses correlation and causation ends up dead.
Thank you Rory.....let me chew on that hint....Thank you for hinting....
Good Afternoon Rory !
Thank you for responding.
I have been on an interesting journey that extended beyond "how" to "what do i want" and "why does my code seem so unclear"
Due to your hint (thank goodness you used italic font), i began the search. i found chip Pearson's article on Default member of a class as well as other similar articles.
Before I try coding with the default (as a learning experience), i have a few questions i want to run by you.
the default code (attribute) is not visible. Hence when things go wrong, i may not understand why. Is this a valid worry from your experience?
When i look at "worksheets.item(1)" i think , Given a collection (called Worksheets), give me the first item in that collection. That IS clear though more chance for error.
When i look at my code, Floors.Floor(1), i should think, Given a collection (called Floors) give me the first Floor in the collection. Not bad when i hear that explanation.
So, Rory, tell me what your choice is in programming. Do you use defaults and does their invisibility both you?
bil
BUT my example in my code is not as clear. Floors.Floor(1)
Another interesting thought
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks