Comment #2 Wednesday, March 15, 2006 9:37 PM

Can you write a simple stopwatch script for me.




Comment #4 Thursday, March 16, 2006 7:37 AM
Comment #5 Thursday, March 16, 2006 10:58 AM

Thank you very much Tiggz.
( I think too all your works are "stellar" )

Comment #6 Friday, March 17, 2006 12:34 PM

Comment #8 Sunday, March 19, 2006 10:30 PM
Comment #10 Wednesday, March 22, 2006 2:21 PM
Dim StartTime
StartTime = Now
then you need to set up a timer in the script to fire every second and get the current date and time, then you can use the 'DateDiff' function to compare the two: DateDiff(interval, date1, date2) ...so
CurrentTime = Now
ElapsedSeconds = DateDiff(s, StartTime, CurrentTime)
ElapsedMinutes = DateDiff(n, StartTime, CurrentTime)
ElapsedHours = DateDiff(h, StartTime, CurrentTime)
then you can use these values to set the text of your displayed time object, maybe something like..
desktopx.object("MyTimeObject").text = ElapsedHours & ":" & ElapsedMinutes & ":" & ElapsedSeconds
you can find out how to work with timers in the script here Link
and you can reference vbscript functions here Link
Comment #11 Wednesday, March 22, 2006 9:00 PM


It says
Invalid procedure call or argument: 'DateDiff' Line: 10 Code: (not available) |
'Called when the script is executed
Dim StartTime
StartTime = Now
Sub Object_OnScriptEnter
object.SetTimer 123, 1
End Sub
Sub Object_OnTimer123
CurrentTime = Now
ElapsedSeconds = DateDiff(s, StartTime, CurrentTime)
ElapsedMinutes = DateDiff(n, StartTime, CurrentTime)
ElapsedHours = DateDiff(h, StartTime, CurrentTime)
End Sub
desktopx.object("MyTimeObject").text = ElapsedHours & ":" & ElapsedMinutes & ":" & ElapsedSeconds
'Called when the script is terminated
Sub Object_OnScriptExit
End Sub
Thats the code i used.

Comment #12 Wednesday, March 22, 2006 10:13 PM

Dim StartTime Sub Object_OnScriptEnter StartTime = Now object.SetTimer 123, 1000 End Sub Sub Object_OnTimer123 CurrentTime = Now 'total number of seconds from the start time to the current time ElapsedSeconds = DateDiff("s", StartTime, CurrentTime) 'these lines split up the total number of seconds into hours. minutes and seconds varSeconds = ElapsedSeconds Mod 60 varMinutes = int((ElapsedSeconds-varSeconds)/60) Mod 60 varHours = int((ElapsedSeconds-varMinutes*60)/60/60) 'these lines will add leading zeroes If varSeconds < 10 Then varSeconds = "0" & varSeconds If varMinutes < 10 Then varMinutes = "0" & varMinutes If varHours < 10 Then varHours = "0" & varHours 'display the result desktopx.object("MyTimeObject").text = varHours & ":" & varMinutes & ":" & varSeconds End Sub |
Comment #13 Thursday, March 23, 2006 6:33 AM



Comment #15 Tuesday, June 13, 2006 9:52 AM
Comment #16 Monday, October 23, 2006 12:59 PM
Any chance of getting an RSS reader?
Comment #17 Thursday, February 28, 2008 1:01 AM


Comment #18 Saturday, July 5, 2008 7:32 AM
Please login to comment and/or vote for this skin.
Welcome Guest! Please take the time to register with us.
There are many great features available to you once you register, including:
- Richer content, access to many features that are disabled for guests like commenting on the forums and downloading files.
- Access to a great community, with a massive database of many, many areas of interest.
- Access to contests & subscription offers like exclusive emails.
- It's simple, and FREE!
Comment #1 Wednesday, March 15, 2006 9:06 PM