Re: globals?



Anon,

Be aware that it is not OOP, you forgot to tell that.

Cor

"_AnonCoward" <abc@xxxxxxx> schreef in bericht
news:45ba5b9b$0$16947$4c368faf@xxxxxxxxxxxxxxxxx

"Smokey Grindle" <nospam@xxxxxxxxxxxxxx> wrote in message
news:u8UQM8XQHHA.3440@xxxxxxxxxxxxxxxxxxxxxxx
:
: Whats the easiest way to make a global function in VB 2005? The
: old way was make a module, is that still the standard? thanks!


Try shared methods. These methods are available to every instance of a
type and can even be accessed without an actual instance being
declared (e.g.: the System.Console.WriteLine() method). It should be
noted that shared methods cannot operate on non-shared members of the
class. The following will not compile:

=========================================
Public Class [class]

Private i As Integer = 0

Public Shared Sub Method()
Console.WriteLine(i)
End Sub

End Class
=========================================


Ralf
--
--
----------------------------------------------------------
* ^~^ ^~^ *
* _ {~ ~} {~ ~} _ *
* /_``>*< >*<''_\ *
* (\--_)++) (++(_--/) *
----------------------------------------------------------
There are no advanced students in Aikido - there are only
competent beginners. There are no advanced techniques -
only the correct application of basic principles.




.



Relevant Pages

  • Re: globals?
    ... old way was make a module, is that still the standard? ... Try shared methods. ... Public Shared Sub Method() ... There are no advanced students in Aikido - there are only ...
    (microsoft.public.dotnet.languages.vb)
  • Re: globals?
    ... Be aware that it is not OOP, ... Try shared methods. ... Public Shared Sub Method() ... There are no advanced students in Aikido - there are only ...
    (microsoft.public.dotnet.languages.vb)

Loading