View Single Post
  #1 (permalink)  
Old November 15th, 2007, 09:51 PM
Sheraz Khan Sheraz Khan is offline
Authorized User
Points: 395, Level: 6
Points: 395, Level: 6 Points: 395, Level: 6 Points: 395, Level: 6
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Join Date: May 2007
Location: London, , United Kingdom.
Posts: 73
Thanks: 4
Thanked 0 Times in 0 Posts
Default Some basic terms

It will be greate if someone explain me the following terms with example in

Option explicit

Static and Shared

I got the basic definations of static and shared but donno are they valid for VB.Net??? If not they what will be correct defination?

Static Variable:
Normally, a local variable in a procedure ceases to exist as soon as the procedure terminates. A static variable remains in existence and retains its most recent value. The next time your code calls the procedure, the variable is not reinitialized, and it still holds the latest value you assigned to it. A static variable continues to exist for the lifetime of the class or module in which it is defined.

Shared Variable:Sharing a member of a class or structure makes it available to every instance, rather than having each instance keep its own copy. This is useful, for example, if the value of a variable applies to the entire application. If you declare that variable to be Shared, then all instances access the same storage location, and if one instance changes the variable's value, all instances access the updated value.

Any definations of all other terms will be appreciated.

Reply With Quote