Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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

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

Posted

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.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...