Notices

Water Fountain General Chit/Chat

Reply
 
LinkBack Thread Tools
Old 10-08-03, 10:17 AM   #16 (permalink)
Aximsite All Star
 
aardWolf's Avatar
Super Member
 
Join Date: Apr 2003
Location: Olive Branch, MS
Posts: 594
Device: iPhone 4GB
Thanked 0 Times in 0 Posts

Awards Showcase
Aximsite Contest Winner Reviewer Medal Aximsite Silver Contributors 
Total Awards: 3

I think you only need the form when you're referencing from another form.

D'oh! I actually DO have eVB installed on this machine... And since we had a huge power outage here a few months ago, my webserver is here. That means I have access to my source code that I have using the timer. It was originally going to be for a virtual pet, but it never got off the ground. Here is the source... enjoy.

Option Explicit
Declare Function Sleep Lib "coredll.dll" (seconds As Integer) As Long
Dim menuisup, x, Number As Integer, apath As String
Private Sub Form_Load()
If App.Path = "\" Then
apath = App.Path
Else
apath = App.Path & "\"
End If

ImageCtl1.Picture = apath & "vpetbg.bmp"
PictureBox1.Picture = apath & "spotblank.bmp"
Menu.Picture = apath & "botbar0.bmp"
Timer1.Interval = 100
Timer1.Enabled = True
Number = -1
Call Timer1_Timer
End Sub
Private Sub Timeout(duration)
On Error Resume Next
Timer1.Interval = 5000
Timer1.Enabled = True
Do While Timer1.Interval > 0

Loop
End Sub
Private Sub Form_OKClick()
App.End
End Sub
Private Sub PictureBox1_Click()
If menuisup = 0 And Number = -1 Then
Number = 0
Do While Number < 5
'nothing
Exit Do
Loop
End If
End Sub

Private Sub Menu_Click()
If menuisup = 1 And Number = 5 Then
Number = 4
Do While Number > 0
'nothing
Exit Do
Loop
End If
End Sub

Private Sub Timer1_Timer()
If Number > -1 And Abs(Number) < 5 Then
Menu.Picture = apath & "botbar" & Abs(Number) & ".bmp"
If menuisup = 0 Then
Number = Number + 1
If Number > 4 Then
menuisup = 1
End If
Else
Number = Number - 1
If Number < 0 Then
menuisup = 0
End If
End If
End If
End Sub
aardWolf is offline   Reply With Quote
Sponsor Ads
Old 10-08-03, 10:59 AM   #17 (permalink)
Aximsite Legend
 
Howard2k's Avatar
Addicted Member
 
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 13,721
Thanked 4 Times in 4 Posts

Awards Showcase
Aximsite Active Silver Member Moderator Medal Silver Poster 
Total Awards: 3

Hmm... ok, so you DO have call timer1_timer.

Now I'm more confused.. I'll keep playing. Thanks though.
__________________
Always read stuff that will make you look good if you die in the middle of it.
Howard2k is offline   Reply With Quote
Old 10-09-03, 12:52 AM   #18 (permalink)
Aximsite Legend
 
Howard2k's Avatar
Addicted Member
 
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 13,721
Thanked 4 Times in 4 Posts

Awards Showcase
Aximsite Active Silver Member Moderator Medal Silver Poster 
Total Awards: 3

ok, got it..

It was the logic that I had wrong. I had to re-organise some of the code but basically the do while loop was killing it.

So I had to re-organise the code without the do while loop..

Use the timer with the exit condition set and checked within the code
Don't call it.
Leave it enabled
Set the interval to 0 or non-0 when required.

Got it all working :)

Thanks for everyone's help.
__________________
Always read stuff that will make you look good if you die in the middle of it.
Howard2k is offline   Reply With Quote
Old 10-09-03, 01:48 AM   #19 (permalink)
Aximsite Elite
 
silentknight's Avatar
Addicted Member
 
Join Date: Jan 2003
Location: GR, Michigan
Posts: 3,380
Device: Nokia 6255i
Carrier: Alltel
Thanked 1 Time in 1 Post

Awards Showcase
Aximsite Active Silver Member Aximsite Veteran Staff Moderator Medal 
Total Awards: 3

Why dont you just put in a lil "Timeout" routine to stop
for a bit? and forget all the timer nonsense
__________________

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


My recent reviews:

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
silentknight is offline   Reply With Quote
Old 10-09-03, 06:57 AM   #20 (permalink)
Aximsite Legend
 
Howard2k's Avatar
Addicted Member
 
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 13,721
Thanked 4 Times in 4 Posts

Awards Showcase
Aximsite Active Silver Member Moderator Medal Silver Poster 
Total Awards: 3

I do need the timer to do stuff, but I wanted execution to 'freeze' until the timer had completed a certain task. :)
__________________
Always read stuff that will make you look good if you die in the middle of it.
Howard2k is offline   Reply With Quote
Reply

Sponsor Ads

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 02:58 PM.
Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0
Copyright © 2003-09 LeckMedia, LLC