Forum     

Go Back   Digit Technology Discussion Forum > Software > Programming
Register FAQ Calendar Mark Forums Read

Programming The destination for developers - C, C++, Java, Python and the lot


Closed Thread
 
LinkBack Thread Tools Display Modes
Old 28-02-2009, 10:24 PM   #1 (permalink)
In The Zone
 
arian29's Avatar
 
Join Date: Feb 2008
Location: New Delhi
Posts: 212
Arrow need help with the below logic/code




')))))))))))))))))))))

'form2

Private Sub Command1_Click()
Unload Form2

Form3.Show
End Sub


')))))))))))))))))))))

'form3

Private Sub Command1_Click()
Unload Form3


Form4.Show

End Sub

Private Sub Form_Load()

Counter = 5

End Sub


Private Sub Timer1_Timer()

Counter = Counter - 1 'we set the counter to count here

Text3.Text = Counter

'If Text3.Text = 0 Then
'MsgBox ("DONE")
'Unload Me
'End If

End Sub

'----------------

what happens is that "Sub Timer1_Timer()" never execited. the focus goes from the first End Sub in form3 to the End Sub in form2 and thats it, nothing happens. "Private Sub Timer1_Timer()" never executes. need some help here pls..
arian29 is offline  
Advertisements. Register and be a member of the community to get rid of them.
Advertisement

Old 28-02-2009, 11:12 PM   #2 (permalink)
Right Off the Assembly Line
 
Join Date: May 2007
Posts: 22
Default Re: need help with the below logic/code

Have you set the timer interval. If yes to what value
silent008 is offline  
Old 01-03-2009, 11:25 AM   #3 (permalink)
In The Zone
 
arian29's Avatar
 
Join Date: Feb 2008
Location: New Delhi
Posts: 212
Default Re: need help with the below logic/code

interval is set to 1000. changed the code to:

'**********************************
'form3

Private Sub Form_Load()

Counter = 5

End Sub


Private Sub Timer1_Timer()

Counter = Counter - 1

Text3.Text = Counter

End Sub

'*************************************

now what happens is the the value of "counter" is always 0 in Timer1_Timer() even though it has been initialized to 5 in Form_Load(). so i am getting -1 as the value in counter when i run the code.
arian29 is offline  
Old 01-03-2009, 06:58 PM   #4 (permalink)
Right Off the Assembly Line
 
Join Date: May 2007
Posts: 22
Default Re: need help with the below logic/code

No doubt the counter has been initialized to 5 in form load, but I think that every second the timer event occurs and counter is decremented so it will have a value of -1 at som point of time.

I am jst trying to help, even i might be wrong
silent008 is offline  
Closed Thread

Bookmarks

Thread Tools
Display Modes

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Partition Logic - the free partitioning software Ponmayilal Reviews 9 24-11-2008 06:13 PM
Logic needed... decimal numbers arian29 Programming 8 29-06-2008 09:28 PM
How to get a Seagte HDD logic card 250GB pata longlife Hardware Q&A 1 23-02-2008 09:51 AM
Where I can find drivers for my Avance logic ALS 120 onboard Uma009 QnA (read only) 3 25-08-2004 09:37 AM

 
Latest Threads
- by gforz
- by soumya
- by Sujeet
- by icebags
- by Charan

Advertisement




All times are GMT +5.5. The time now is 03:08 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.

Search Engine Optimization by vBSEO 3.3.2