make the variable known[solved]
if i do something like this how would i make the variable "play" value
change all over the program?
VB Code:
Dim play as byte
Private Sub Form_Load()
play = 1
End Sub
Private Sub start_Click()
If play = 1 Then
starter
play = 0
End If
End Sub
Sub starter()
Timer1.Interval = 1 ' for 1 millisec
Timer1.Enabled = True
stupid.Caption = ""
play = 1
countt.Caption = "Count to?"
End If
Next i
End Sub
something like that
in the Sub starter, play is changed to "1"
but does it only change it in that Sub? or does it change the global variable?
do i make sense or do i got it all wrong?
Re: make the variable known
it doesnt change for each form, but it does change for the form you called it on.
so if you gave it the value 1 in form load, it will remain 1 until you change it
Re: make the variable known
but when u change the vaule in one Sub, does it change it all over that same form?
Re: make the variable known
Re: make the variable known
Quote:
Originally Posted by rodrigorules
but when u change the vaule in one Sub, does it change it all over that same form?
Yes, as long as you have it defined in the Declarations section of the form as you seem to have done.