ThePentiumGuy Posted February 16, 2004 Posted February 16, 2004 hey what does the STatic variable type do and what does Shadows variable type do? thanks Quote My VB.NET Game Programming Tutorial Site (GDI+, Direct3D, Tetris [coming soon], a full RPG.... you name it!) vbprogramming.8k.com My Project (Need VB.NET Programmers) http://workspaces.gotdotnet.com/ResolutionRPG
Administrators PlausiblyDamp Posted February 16, 2004 Administrators Posted February 16, 2004 shadows more shadows static Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
ThePentiumGuy Posted February 16, 2004 Author Posted February 16, 2004 ah - so basically if you say sub button1.click dim x as integer x+=1 msgbox(x) end sub you'll get 1 every time you click the button becuase its dimmed again.. but sub button1.click Static x as integer x+=1 msgbox(x) end sub each time you click the button x getes incremented by 1 and it displays 1,2,3,4.. etc hopefully i understood that correctly Quote My VB.NET Game Programming Tutorial Site (GDI+, Direct3D, Tetris [coming soon], a full RPG.... you name it!) vbprogramming.8k.com My Project (Need VB.NET Programmers) http://workspaces.gotdotnet.com/ResolutionRPG
Procaine Posted February 17, 2004 Posted February 17, 2004 Yup, that's exactly it. The way I look at it is it's a combination of a local variable (it's only accessable to the currently method) and one with class scope (it value is held between method calls). It's a pretty useful thang. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.