Re: shared...
From: Trev Hunter (hunter_trev_at_hotmail.com)
Date: 02/01/04
- Next message: Herfried K. Wagner [MVP]: "Re: ot: Re: Maximum possible form height is 780 pixels?"
- Previous message: Brian Henry: "shared..."
- In reply to: Brian Henry: "shared..."
- Next in thread: Herfried K. Wagner [MVP]: "Re: shared..."
- Messages sorted by: [ date ] [ thread ]
Date: Sun, 1 Feb 2004 19:56:58 -0000
In VB, the "shared" keyword marks the member as shared between all instances
of that class, so I guess you could think it as the same as the "static"
keyword in C++. I don't have much experience in C++, but from your
definition, they are the same.
VB does have a "static" keyword, but this is reserved for local function
variables that persist their state between function calls.
In VB.net a module acts like a shared class - it's the same as a class that
has all its members marked with the "shared" keyword.
Have a look at
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vblr7/html/vakeyShared.asp
for more information.
HTH,
Trev.
"Brian Henry" <brianiup[nospam]@adelphia.net> wrote in message
news:eHsdpwP6DHA.2760@TK2MSFTNGP09.phx.gbl...
> When you say shared in vb what does it exactly mean... the other languages
> use static in the same place of this in .NET here is an example
>
> [Visual Basic]
> Public Shared Event Idle As EventHandler
>
> Shared = Static according to the .net documenation ive read... in c++ we
> used static to mean a value that stayed there all the time such as a
counter
> that kept track of how many times a class member was called from any
number
> of instantiations... for an example... a item that stayed in memory over
any
> number of instantiations... what does this shared clause mean in vb? is it
> similar to what i described or diffrent.. thanks!
>
>
- Next message: Herfried K. Wagner [MVP]: "Re: ot: Re: Maximum possible form height is 780 pixels?"
- Previous message: Brian Henry: "shared..."
- In reply to: Brian Henry: "shared..."
- Next in thread: Herfried K. Wagner [MVP]: "Re: shared..."
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|