VB program to show working of static variable and local variable

Working of static variable and local variable 

Sample :



I can't show you complete code Directly so download full code from below .

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