|
-
Nov 3rd, 2000, 10:02 PM
#1
Thread Starter
Junior Member
Hi! I need to make a counter that doesn't use the clock time.
And I need that when it gets to 60 seconds, it starts like 00:01:00, and when it gets to 60 minutes, it gets 01:00:00, and so on, like a real clock.
Is it clear??
Thank you!!
-
Nov 3rd, 2000, 10:28 PM
#2
Is this what you want?
Code:
Private Sub Command1_Click()
Time = "00:00:00"
Do
Label1.Caption = Format(Time, "hh:nn:ss")
DoEvents
Loop
End Sub
-
Nov 6th, 2000, 06:47 PM
#3
_______
<?>
and what is wrong with the example given?
It does what you want does it not?
"A myth is not the succession of individual images,
but an integerated meaningful entity,
reflecting a distinct aspect of the real world."
___ Adolf Jensen
-
Nov 6th, 2000, 06:52 PM
#4
transcendental analytic
Maybe you could use timeserial function
Code:
static n&
timeserial(0,0,n)
n=n+1
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Nov 6th, 2000, 07:11 PM
#5

It starts from 00:00:00 and goes up:
00:00:01
00:00:02
00:00:03
00:00:04
00:00:05
00:00:06
00:00:07
00:00:08
00:00:09
00:00:10
'^seconds
....
00:01:00
00:02:00
00:03:00
00:04:00
00:05:00
00:06:00
00:07:00
00:08:00
00:09:00
00:10:00
'^minutes
01:00:00
02:00:00
03:00:00
04:00:00
05:00:00
06:00:00
07:00:00
08:00:00
09:00:00
10:00:00
'^hours
Is that not what you wanted?
Kids these days, back in my day...we took what we were given, no questions asked .
-
Nov 7th, 2000, 08:45 PM
#6
Thread Starter
Junior Member
Here I am again
Ok. It does, in part, what I need: it counts like that, but it modifies the CPU time, and I don't want it.
I need it to count, like it does but not using or modifying in any way, the CPU time. Am I clear? I hope so. I know my english may not be so clear as I'd like, but...
Thank You!!
-
Nov 8th, 2000, 01:06 AM
#7
transcendental analytic
put my code in a timer with interval set to 1000
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Nov 8th, 2000, 01:32 AM
#8
Frenzied Member
Is this what you are looking for?....
Here it is the old-fashoined way... Put a label and a timer on a form and paste the following code into the form's code window. (Use the default names for the controls).
This should give you the functionality that you are looking for without using the system time, Time function, or any other intrinsic "stuff"...
Code:
Option Explicit
Private Sub Form_Load()
Label1 = "00:00:00"
Timer1.Interval = 1000
End Sub
Private Sub Timer1_Timer()
Static intSecond As Integer
Static intMinute As Integer
Static intHour As Integer
intSecond = intSecond + 1
If intSecond = 60 Then
intSecond = 0
intMinute = intMinute + 1
End If
If intMinute = 60 Then
intMinute = 0
intHour = intHour + 1
End If
If intHour = 13 Then intHour = 1
DisplayTime intHour, intMinute, intSecond
End Sub
Private Sub DisplayTime(intHour As Integer, intMinute As Integer, intSecond As Integer)
Dim strTime As String
If intHour < 10 Then strTime = strTime & "0"
strTime = strTime & intHour & ":"
If intMinute < 10 Then strTime = strTime & "0"
strTime = strTime & intMinute & ":"
If intSecond < 10 Then strTime = strTime & "0"
strTime = strTime & intSecond
Label1 = strTime
End Sub
Hope that helps!
[Edited by seaweed on 11-08-2000 at 01:37 AM]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|