VB6's private static in C# ?
- by blez
In VB6 there are local static variables that keep their values after the exit of procedure. It's like using public vars but on local block. For example:
sub count()
static x as integer
x = x + 1
end sub
After 10 calls, x will be 10. I tried to search the same thing in .NET (and even Java) but there was none. Why? Does it break the OOP model in some way, and is there a way to emulate that.