Hi Jay,
I am under the belief that "Static"(in Visual Basic) can be used for local
instance level variable: whereas Shared is a class level variable.
Hence Static and Shared are different. The help of static keyword shows the
following...
The Static keyword indicates that one or more declared variables are static.
Static variables remain in existence and retain their latest values after
termination of the procedure in which they are declared.
The Static keyword is used in this context:
IS something wrong with my understanding??
You can declare a local static variable using the following syntax:
Static Dim x as Integer = 1
The value of x is retained even after the termination of the procedure.
"Jay B. Harlow [MVP - Outlook]" <Ja********@email.msn.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
The8thSense,
As Rahul suggested. You would use the Shared keyword in VB.NET where you
would use the static keyword in C# or C++.
Hope this helps
Jay
"The8thSense" <th*********@yahoo.com> wrote in message
news:uZ**************@tk2msftngp13.phx.gbl... how to declare static varible and static method inside a class ?
i try
"public static ABC as integer = 10"
and it said my declaration is invalid
Thanks