This is the first Tutorial I have done in a while. I have been working, sick, busy, and to tired to do much of anything for a while.
I am working on a Coundown Clock for the BIRTHDAY community project and I want this to be a multiple part Tutorial on how to make your own. The First thing we need to do is be able to figure out the Days, Hours, Mins, Seconds between now and Midnight on such-and-such date. For this example we will use a REALLY important date in DX history... MY BIRTHDAY!!!
Lets break down the above code.
Sub Object_OnScriptEnterRuns when the object is loaded
BDate = cdate("11/20/2008") Sets the Birthday Date to 11/20/2008, you can put in ANY date for now. it needs to be in your "local" format i believe.
object.text = "Calculating" Default Text to show
Object.SetTimer 1, 1000 This turns on a timer called 1000 and runs what's in there every 1,000 milliseconds or 1 second
End SubEnds the OnScriptEnter prrocedure
Sub Object_OnTimer1 This is the Timer we started above, notice the 1 is the same as the 1, in our SetTimer call
CurTime = formatdatetime(now,3)Sets the Var CurTime to the Current Date in a format that shows hh:mm:ss a/pm
When you run the above you should see something that looks like:
Date: Wednesday, October 29, 2008BDate: Thursday, November 20, 2008Time: 1:07:36 PMDays: 21Hours: 10Mins: 52Secs: 24
This is just part 1, I will add more as i move on in making this new countdown gadget.
Hope someone makes use out of this.
RomanDA
Dave, you're a good man!Thank's for all the great stuff you've made, and all the help you've provided!
Just what I needed for a project Seabass and I are working on!
Thanks David!
Hope you're feeling better!
Thanks for the teaching!
Part 2 on its way
I believe you meant a timer called 1
yep u r right
As a relatively new member who has recieved much help from all of your tutorials RomanDA, I just want you to know that there are people out here that really appriciate what you're doing. Especially those like me who think in more 'visual' terms as an artist and don't do as well with coding. Thank you.
There are many great features available to you once you register, including:
Sign in or Create Account