Chronometer

Shay

Well-Known Member
Licensed User
Longtime User
Hi

2 questions:

1. Can I make the clock count backward? if not which clock to use?
2. Can I make the chronometer to count faster - meaning each sec will count 5 seconds - if not which clock to use instead of the chronometer

Thanks
Shay
 

klaus

Expert
Licensed User
Longtime User
You must be more precise on what you want to do.
I'm afraid that you won't find any 'clock' doing this.
You must doing it on your own by code with a diplay and timer(s).
For your backward clock, use a timer and count backwards.
For the chronometer use a timer, with a 1 second interval, and add 5 each time.
But without knowing exactly what kind of clock or chronometer you want to do it is difficult to give you the best advice. It will also depend on the precision you need or want to achieve. Then you must manage the clock or chronometer with the activity lifetime, for example if your program is supposed to work in both orientations.

Best regards.
 
Upvote 0

Shay

Well-Known Member
Licensed User
Longtime User
I need two things
one timer that count backwards
second to incrase timer speed on the chronometer or something similar
 
Upvote 0

stevel05

Expert
Licensed User
Longtime User
The direction of the timer is irrelevant, it' just fires the _tick event at a preset time (which may not be exact depending on what else is running). You should manage a Global variable within the _tick event. i.e.
'Sub Process_Globals
Dim Timer1 As Timer

Dim Seconds As Int 'or Long

Sub Activity_Create
Timer1.Initialize("Timer1",1000)
Timer1.Enabled=True

Sub Timer1_Tick

Seconds=Seconds-1

End sub

To change the frequency of the call to the sub use Timer1.Interval

Steve
 
Last edited:
Upvote 0

Shay

Well-Known Member
Licensed User
Longtime User
till now I used the chronometer and not the timer
I can try to use the timer
but can you direct me on how to draw the timer
is there any ready code for clock here using the timer
 
Upvote 0

stevel05

Expert
Licensed User
Longtime User
I've never had the need to draw a clock, have you searched the forums? You may have to try it and ask specific questions if you get stuck.
 
Upvote 0

Shay

Well-Known Member
Licensed User
Longtime User
yes - cannot find what i need

how can I take simple label and make it clock?

I am trying to do:
dim my_clock as timer


sub my_clock_tick
secs=secs+1
label_my_clock.text = my_clock
end sub
 
Upvote 0

stevel05

Expert
Licensed User
Longtime User
You are assigning the timer object to the label text. You probably want

label_my_clock.text =secs

Steve
 
Upvote 0
Top