OK, I've looped through a text file and loaded a timer control with names of which are in the text file, works fine. But after the control is loaded, I want it to increase a variable by 1. How would I do this? Or is it possible? Thanks! :)
Printable View
OK, I've looped through a text file and loaded a timer control with names of which are in the text file, works fine. But after the control is loaded, I want it to increase a variable by 1. How would I do this? Or is it possible? Thanks! :)
Variable = Variable + 1
I know that.Quote:
Originally posted by Ken Whiteman
Variable = Variable + 1
But, I want to make the timer I loaded at runtime increase the variable by 1......possible? Or am I just over looking something?
If you have loaded a timer at runtime, then it should have an index of 0.
Use the Timer event under that index to do the job.
Timer1_Timer(Index as Integer)
if index = 1 then
Variable = Variable + 1
end if
I'm sorry. I do not understand...Quote:
Originally posted by Ken Whiteman
If you have loaded a timer at runtime, then it should have an index of 0.
Use the Timer event under that index to do the job.
Timer1_Timer(Index as Integer)
if index = 1 then
Variable = Variable + 1
end if
I'm making a MUD(text game) and I want a timer with the name I just created here:
Code:Sub AddTimers(FileName As String)
Dim lstInput As String
On Error Resume Next
Open FileName$ For Input As #1
While Not EOF(1)
Input #1, lstInput$
'DoEvents
Set Control = Controls.Add("VB.timer", ReplaceText(lstInput$, " ", "") + "HP")
With Control
.Enabled = True
.Interval = 1000
End With
Wend
Close #1
End Sub
'<---Add the timers at run time with names in users.txt--->
Private Sub Form_Load()
FormOnTop Me.hwnd, True
Call AddTimers("C:\Rag\users.txt")
End Sub
...to raise a variable (HP, or Life) 1 per second.
Maybe I'm not very clear? Sorry my english is bad...:o