By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,745 Members | 1,873 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,745 IT Pros & Developers. It's quick & easy.

Code running on a particular time

P: 10
Hi
I need to run a code on a particular period of time, for which i have been asked not to use a scheduler. I have an idea of using a timer that will call my cord.But i am not clear about the steps i need to follow in developing a timer script
Can anyone guide me in developing this code.
i will be thankful to whatever help being offered too.
thanks
Mano
Jan 1 '08 #1
Share this Question
Share on Google+
2 Replies


kadghar
Expert 100+
P: 1,295
Hi
I need to run a code on a particular period of time, for which i have been asked not to use a scheduler. I have an idea of using a timer that will call my cord.But i am not clear about the steps i need to follow in developing a timer script
Can anyone guide me in developing this code.
i will be thankful to whatever help being offered too.
thanks
Mano
Im not sure im getting what you need, but yes, you can leave a timer running with something like:
Expand|Select|Wrap|Line Numbers
  1. if time >= StartingTime and boo1 = false then
  2.     call Procedure1  ' Or any sub you want to run
  3.     boo1=true
  4. elseif time >= FinishTime then 
  5.     end
  6. end if
Make sure you define Boo1 as a boolean outside the timer, so once the code runs for the first time, you wont run it again and again and again.Im not sure if "time" works for every version of VB, if it doesnt works, find out how to call the system's clock.

HTH
Jan 2 '08 #2

P: 10
Im not sure im getting what you need, but yes, you can leave a timer running with something like:
Expand|Select|Wrap|Line Numbers
  1. if time >= StartingTime and boo1 = false then
  2.     call Procedure1  ' Or any sub you want to run
  3.     boo1=true
  4. elseif time >= FinishTime then 
  5.     end
  6. end if
Make sure you define Boo1 as a boolean outside the timer, so once the code runs for the first time, you wont run it again and again and again.Im not sure if "time" works for every version of VB, if it doesnt works, find out how to call the system's clock.

HTH

thanks for ur help sorry i could not reply immediately as i have been assigned with another task... am trying out the solution too... thankful to the help that was rendered
will get backl again if i encounter any problem
thanks again

mano
Jan 6 '08 #3

Post your reply

Sign in to post your reply or Sign up for a free account.