VB timer countdown. plz help! (homework assignment)

when the timer has finished countdown how will you stop the preview bu

Page 1 of 1

6 Replies - 12333 Views - Last Post: 05 June 2008 - 12:08 AM Rate Topic: -----

#1 tj.dinner.619  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 24-May 06

VB timer countdown. plz help! (homework assignment)

Posted 24 May 2006 - 06:30 PM

hey. i have made a timer to countdown in visual basics 6.0 , but i need it stop the game i made when the countdown is finished. This is Part of an assignment .

P.S. I am not a computer guy.
Is This A Good Question/Topic? 0
  • +

Replies To: VB timer countdown. plz help! (homework assignment)

#2 born2c0de  Icon User is offline

  • printf("I'm a %XR",195936478);
  • member icon

Reputation: 180
  • View blog
  • Posts: 4,667
  • Joined: 26-November 04

Re: VB timer countdown. plz help! (homework assignment)

Posted 25 May 2006 - 01:04 AM

What does the timer do?
Is it like a Countdown Timer which shuts or gives an alarm on ZERO?

Keep a global variable and keep incrementing or decrementing it in the Timer Subroutine and disable the timer when it reaches ZERO.
It should work out to be something like this:
Private Sub Timer1_Timer()
	  g_count = g_count - 1
	  ' Assuming g_count is a global variable
	  if g_count = 0 then timer1.enabled = false
End Sub



Since you said you're not a computer guy, I'm not exactly sure whether my post will be understood by you (global variables etc.).

If you have any queries, feel free to post again.
Was This Post Helpful? 0
  • +
  • -

#3 born2c0de  Icon User is offline

  • printf("I'm a %XR",195936478);
  • member icon

Reputation: 180
  • View blog
  • Posts: 4,667
  • Joined: 26-November 04

Re: VB timer countdown. plz help! (homework assignment)

Posted 25 May 2006 - 01:11 AM

One more thing...have you made an attempt to solve this assignment?

If so then please post whatever you have written as we can then correct you and tell you where you went wrong.
Was This Post Helpful? 0
  • +
  • -

#4 William_Wilson  Icon User is offline

  • lost in compilation
  • member icon

Reputation: 205
  • View blog
  • Posts: 4,807
  • Joined: 23-December 05

Re: VB timer countdown. plz help! (homework assignment)

Posted 25 May 2006 - 03:06 PM

VB is probably the best language for beginners in computers/programming as it is mostly drag and drop and the graphics are taken care of :)
It is likely a slimple logic error, which could be resolved once the code is posted.
Was This Post Helpful? 0
  • +
  • -

#5 born2c0de  Icon User is offline

  • printf("I'm a %XR",195936478);
  • member icon

Reputation: 180
  • View blog
  • Posts: 4,667
  • Joined: 26-November 04

Re: VB timer countdown. plz help! (homework assignment)

Posted 25 May 2006 - 09:58 PM

Quote

VB is probably the best language for beginners in computers/programming as it is mostly drag and drop and the graphics are taken care of

I'd say the same thing...only without the word 'probably' ;)
Was This Post Helpful? 0
  • +
  • -

#6 Keelan  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 04-June 08

Re: VB timer countdown. plz help! (homework assignment)

Posted 04 June 2008 - 08:07 PM

View Postborn2c0de, on 25 May, 2006 - 01:04 AM, said:

What does the timer do?
Is it like a Countdown Timer which shuts or gives an alarm on ZERO?

Keep a global variable and keep incrementing or decrementing it in the Timer Subroutine and disable the timer when it reaches ZERO.
It should work out to be something like this:
Private Sub Timer1_Timer()
	  g_count = g_count - 1
	  ' Assuming g_count is a global variable
	  if g_count = 0 then timer1.enabled = false
End Sub



Since you said you're not a computer guy, I'm not exactly sure whether my post will be understood by you (global variables etc.).

If you have any queries, feel free to post again.





This code doesn't work for me, it does it once then stops. If I make my variable = 30 then it will subtract once, when I want it to count down to 0
Was This Post Helpful? 0
  • +
  • -

#7 Zhalix  Icon User is offline

  • D.I.C Regular

Reputation: 20
  • View blog
  • Posts: 260
  • Joined: 07-May 08

Re: VB timer countdown. plz help! (homework assignment)

Posted 05 June 2008 - 12:08 AM

Could you post the code you have?

Your problem will be solved much more quickly if we can see the code that is causing problems.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1