- This topic has 4 replies, 3 voices, and was last updated 19 years ago by Admin.
-
AuthorPosts
-
November 22, 2004 at 9:45 pm #190165AdminAdministrator
😆 wha up peeps, any one had any tips on how to stop a program from freezing, like this program i made
The problem I am having is that when lets say the user chooses the 10 seconds brake between each message, And when the program is in action and they decide to stop it it freezes.
lol dont know it got to do with some timer thing, like when the process start is hard to stop or some shit, dont know
so is there some thing i can put like between each message here is the code anyways for the 10 seconds message brake in a timer
If Check1.Value = 1 Then
Call RoomSend(RichTextBox1.TextRTF)
DoEvents
Sleep 10000
End If
If Check2.Value = 1 Then
Call RoomSend(RichTextBox2.TextRTF)
DoEvents
Sleep 10000
End If
If Check3.Value = 1 Then
Call RoomSend(RichTextBox3.TextRTF)
DoEvents
Sleep 10000
End If
If Check4.Value = 1 Then
Call RoomSend(RichTextBox4.TextRTF)
DoEvents
Sleep 10000
End If
If Check5.Value = 1 Then
Call RoomSend(RichTextBox5.TextRTF)
DoEvents
Sleep 10000
End IfThanks 🙂
November 22, 2004 at 9:46 pm #190169AdminAdministratorLol I think I fix went to
And found this cool code
Basically I added this code
Sub Delay(ByVal nSeconds As Single)
Dim nStart As Single
nStart = Timer
Do
DoEvents
Loop Until Timer - nStart >= nSeconds
End Sub
Then I change the timer code to this
If Check1.Value = 1 Then
Call RoomSend(RichTextBox1.TextRTF)
DoEvents
Call Delay(10)
End If
If Check2.Value = 1 Then
Call RoomSend(RichTextBox2.TextRTF)
DoEvents
Call Delay(10)
End If
If Check3.Value = 1 Then
Call RoomSend(RichTextBox3.TextRTF)
DoEvents
Call Delay(10)
End If
If Check4.Value = 1 Then
Call RoomSend(RichTextBox4.TextRTF)
DoEvents
Call Delay(10)
End If
If Check5.Value = 1 Then
Call RoomSend(RichTextBox5.TextRTF)
DoEvents
Call Delay(10)
End IfYess it doesnt freeses nomore 😈
November 23, 2004 at 8:17 pm #190168KittenlessMemberyeah it was the acutall sleep command..
the sleep command tells windows to basically ignore the application for that amount of time and give it no CPU time.
the other “Delay” allows you to skip doing stuff until the “time” is up..
basically thats what the difference between the two..
lol
November 23, 2004 at 8:33 pm #190167AdminAdministratoryeps with the first one, it always freeze, so it was a life saver 🙂
April 3, 2005 at 12:43 am #190166Johnny5MemberTry to Debug point cursor on loop then debug it
-
AuthorPosts
Related
- You must be logged in to reply to this topic.