dbTalk Databases Forums  

Friend in classes

comp.databases.ms-access comp.databases.ms-access


Discuss Friend in classes in the comp.databases.ms-access forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
The Frog
 
Posts: n/a

Default Friend in classes - 04-13-2011 , 02:38 AM






Just a quick question: does anyone use the keyword Friend anytime they
are building a class? I dont and I was just wondering if others do.

Cheers

The Frog

Reply With Quote
  #2  
Old   
Eggs
 
Posts: n/a

Default Re: Friend in classes - 04-13-2011 , 02:42 PM






On Apr 13, 12:38*am, The Frog <mr.frog.to.... (AT) googlemail (DOT) com> wrote:
Quote:
Just a quick question: does anyone use the keyword Friend anytime they
are building a class? I dont and I was just wondering if others do.

Cheers

The Frog
You know, I think you make a good point. I don't use the keyword
Friend any more either. I think we should all start doing that again
and maybe some of the rudeness would drop away and we'd start seeing
more politeness like in the old days.

Reply With Quote
  #3  
Old   
Tom van Stiphout
 
Posts: n/a

Default Re: Friend in classes - 04-14-2011 , 01:13 AM



On Wed, 13 Apr 2011 12:42:17 -0700 (PDT), Eggs <egginox (AT) yahoo (DOT) com>
wrote:

LOL. While I agree with the sentiment, I'm pretty sure the OP meant
the Friend keyword as it is supported by most object-oriented
languages. Alas, VBA is not one of them.

-Tom.
Microsoft Access MVP


Quote:
On Apr 13, 12:38*am, The Frog <mr.frog.to.... (AT) googlemail (DOT) com> wrote:
Just a quick question: does anyone use the keyword Friend anytime they
are building a class? I dont and I was just wondering if others do.

Cheers

The Frog

You know, I think you make a good point. I don't use the keyword
Friend any more either. I think we should all start doing that again
and maybe some of the rudeness would drop away and we'd start seeing
more politeness like in the old days.

Reply With Quote
  #4  
Old   
The Frog
 
Posts: n/a

Default Re: Friend in classes - 04-14-2011 , 08:48 AM



Hi Guys,

Eggs, you are of course correct. That being said I find this newsgroup
to be most helpful and friendly, especially when I copmare it to some
of the others. I have seen some appalling language and lack of common
courtesy for example in various Java newsgroups and Excel VBA Macros.
On the whole I prefer to spend my limited time here to learn from
experienced experts who graciously share their time and knowledge
(sucking up is friendly right?).

Tom, the OO keyword Friend is available in VBA, I am just not sure
that it has any use. To quote from the helpfile:

"Modifies the definition of a procedure in a form module or class
module to make the procedure callable from modules that are outside
the class, but part of the project within which the class is defined.
Friend procedures cannot be used in standard modules."

Since I am aware of no actual way to create a second project inside
the one Office document / Access database file I can only assume that
it might have some use in a library database, but cant see how. I am
finding myself running into the limits of the OO capabilities quite a
bit at the moment, but as was the case with the first lightbulb there
are many ways to achieve what needs to be done and they dont all work
on the first try.

Cheers

The Frog

Reply With Quote
  #5  
Old   
Tom van Stiphout
 
Posts: n/a

Default Re: Friend in classes - 04-14-2011 , 11:43 PM



On Thu, 14 Apr 2011 06:48:00 -0700 (PDT), The Frog
<mr.frog.to.you (AT) googlemail (DOT) com> wrote:

Maybe an add-in would be such a second project.

-Tom.
Microsoft Access MVP


Quote:
Hi Guys,

Eggs, you are of course correct. That being said I find this newsgroup
to be most helpful and friendly, especially when I copmare it to some
of the others. I have seen some appalling language and lack of common
courtesy for example in various Java newsgroups and Excel VBA Macros.
On the whole I prefer to spend my limited time here to learn from
experienced experts who graciously share their time and knowledge
(sucking up is friendly right?).

Tom, the OO keyword Friend is available in VBA, I am just not sure
that it has any use. To quote from the helpfile:

"Modifies the definition of a procedure in a form module or class
module to make the procedure callable from modules that are outside
the class, but part of the project within which the class is defined.
Friend procedures cannot be used in standard modules."

Since I am aware of no actual way to create a second project inside
the one Office document / Access database file I can only assume that
it might have some use in a library database, but cant see how. I am
finding myself running into the limits of the OO capabilities quite a
bit at the moment, but as was the case with the first lightbulb there
are many ways to achieve what needs to be done and they dont all work
on the first try.

Cheers

The Frog

Reply With Quote
  #6  
Old   
The Frog
 
Posts: n/a

Default Re: Friend in classes - 04-15-2011 , 03:44 AM



Tom, you may be right. An add-in to elevate the VBA IDE to the
capabilities of full VB6 probably wouldnt be a bad idea. Be a tricky
one to write I imagine as you would have to be extremely careful not
to 'break' the VBA environment and that anything written was
compatible with VBA environments that dont have the add-in.

With A2010 (which I havent seen yet, I am still with A2003) is the IDE
and VBA the same as earlier versions? I have heard that .Net can be
directly integrated (ie/ code modules) but perhaps this is only with
the VSTO. I am most curious to explore this avenue and 'better' the
IDE, but I expect it will be a slow process to develop such a thing.

Cheers

The Frog

Reply With Quote
  #7  
Old   
David-W-Fenton
 
Posts: n/a

Default Re: Friend in classes - 04-17-2011 , 03:46 PM



Tom van Stiphout <tom7744.no.spam (AT) cox (DOT) net> wrote in
news:s24dq6hgsrsaccehpcce2nuelo3fiui2fl (AT) 4ax (DOT) com:

Quote:
I'm pretty sure the OP meant
the Friend keyword as it is supported by most object-oriented
languages. Alas, VBA is not one of them.
Well, of course it's not, as VBA is not object-oriented.

--
David W. Fenton http://www.dfenton.com/
contact via website only http://www.dfenton.com/DFA/

Reply With Quote
  #8  
Old   
David-W-Fenton
 
Posts: n/a

Default Re: Friend in classes - 04-17-2011 , 03:50 PM



The Frog <mr.frog.to.you (AT) googlemail (DOT) com> wrote in
news:9848f651-ff3e-499a-8e5b-ce9e641b1e72 (AT) p3g2000vbv (DOT) googlegroups.com
:

Quote:
Tom, you may be right. An add-in to elevate the VBA IDE to the
capabilities of full VB6 probably wouldnt be a bad idea.
That comment makes no sense at all, as VBA is a superset of VB. That
is, VBA has more functionality in it than VB itself.

[]

Quote:
With A2010 (which I havent seen yet, I am still with A2003) is the
IDE and VBA the same as earlier versions? I have heard that .Net
can be directly integrated (ie/ code modules) but perhaps this is
only with the VSTO. I am most curious to explore this avenue and
'better' the IDE, but I expect it will be a slow process to
develop such a thing.
I noticed the other day when activating Office 2010 that there is
..NET support in the installer for Access, but I assumed it was not
usable so did not install it (I wouldn't use it even if it were
usable). This was based on the fact that I know that Word and Excel
can integrate .NET components, but that Access cannot, at least in
versions through 2007.

Frankly, I don't see any benefit at all in integrating .NET into a
COM-based environment. What do you accomplish, except to demote the
capabilities of .NET to be no greater than those of VBA itself?

--
David W. Fenton http://www.dfenton.com/
contact via website only http://www.dfenton.com/DFA/

Reply With Quote
  #9  
Old   
David-W-Fenton
 
Posts: n/a

Default Re: Friend in classes - 04-17-2011 , 03:52 PM



The Frog <mr.frog.to.you (AT) googlemail (DOT) com> wrote in
news:f3d82664-d6ce-4df9-9e35-92be64838962 (AT) l30g2000vbn (DOT) googlegroups.co
m:

Quote:
Tom, the OO keyword Friend is available in VBA, I am just not sure
that it has any use. To quote from the helpfile:

"Modifies the definition of a procedure in a form module or class
module to make the procedure callable from modules that are
outside the class, but part of the project within which the class
is defined. Friend procedures cannot be used in standard modules."
I vaguely recall something about library databases and modules or
class modules being usable from them. In the past we wrote out the
file with SaveAsText, edited the property in question (which I
forget) and then re-imported it in order to make it visible (and
usable) from other projects. But I completely forget all the details
-- I just recall the basic process. It was something I had run into
as a problem, but never actually ended up needing to use this
solution.

--
David W. Fenton http://www.dfenton.com/
contact via website only http://www.dfenton.com/DFA/

Reply With Quote
  #10  
Old   
The Frog
 
Posts: n/a

Default Re: Friend in classes - 04-18-2011 , 02:59 AM



Hi David,

I was not aware that A2010 had the potential for .Net integration. You
could probably make some nice add-ins with .Net and also probably
cannabalise a lot of the solutions / code available on the net for
saolving various odds-n-sods. My interest in .Net integration is OO
related. With regards to VBA vs VB I am not so much comparing the
languages as the IDE's. The VBA IDE IMO is missing a few things that
would be quite helpful, such as being able to set class attributes,
hide procedures / properties that dont need to be shown and so on.
Nothing major, just a few tweaks. Being able to have multiple VBA
projects in a single 'Office Document' (such as an MDB file) would be
useful to me too. I do the import export thing at the moment to set
attributes, but hiding the default enumerator on a collection class is
just not possible (VBA quietly ignores the attribute setting).

I was mucking about with a few friends on the weekend and one of them
had an interesting suggestion. Create a 'standard' application that is
fixed in its functionality - it simply acts as a framework. Deploy
this to as many people as you wish - it is valueless by itself. To
distribute your application you ship a library database with all the
forms, reports, etc... which the FE knows how to read and use. The FE
could then in theory use as many libraries as is needed to produce a
completely 'modular' application. I said that it is an interesting
idea but that it is probably better to do something like that with
another tool instead of Access. IMO you would really need a full OO
environment to handle something like that, but perhaps I am wrong. Its
a moot point I suppose as the VBA IDE would make developing something
like that hell.

Cheers

The Frog

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.