Working of static variable and local variable
Sample :
Dim exvar As Single
Private Sub Command1_Click()
Dim locvar As Single
Static stavar As Single
locvar = locvar + 1
stavar = stavar + 1
exvar = exvar + 1
Text1.Text = Str(locvar)
Text2.Text = Str(stavar)
Label1.Caption = "Count: " & Str(exvar)
End Sub
Full Code :
Output(static.exe)
Full code(static.doc)
Full project(static.zip)
*Note Full project require Visual Basic 6.0