PROFESSIONAL NEWSGROUPS
WINDEV
,
WEBDEV
and
WINDEV Mobile
Home
|
Recent messages
|
Connect
|
Sign out
|
English
Home
→
WINDEV 25
→
Relógio via código usando as procedures TIMER_STOP, TIMER_LOOP, TIMER_PLAY, TIMER_BREAK
Relógio via código usando as procedures TIMER_STOP, TIMER_LOOP, TIMER_PLAY, TIMER_BREAK
Started by Boller, Sep., 22 2020 12:49 PM - No answer
Connect yourself…
Boller
#1
Registered member
3,655 messages
Popularité : +175 (223 votes)
Posted on September, 22 2020 - 12:49 PM
Prezados,
Segue abaixo um conjunto de procedures para trabalhar com TIMER de Relógio via código usando as procedures:
TIMER_PLAY = INICIA O CONTADOR E O LOOP
TIMER_LOOP = TODOS OS PROCESSOS SEQUENCIAIS A SEREM FEITOS A CADA CICLO
TIMER_STOP = PARA DE CONTAR ATE QUE DER TIMER_PLAY
TIMER_BREAK = PAUSA OU FREIA
Procedure
Timer_Break
(
)
//Suspend the stopwatch
Loc_Timer_Pause
=
True
//Time the time passed that must not be counted
ChronoStart
(
2
)
Procedure
Timer_Play
(
)
//If there is a start time for the stopwatch, it means that time calculation resumes after a stop
IF
Loc_Timer_Pause
=
True
THEN
//Duration not to count in milliseconds (it is a cumulated duration for all the stops performed)
du
Duration
is
Duration
=
ChronoEnd
(
2
)
gdu
TimeNotCounted
+
=
du
Duration
Loc_Timer_Pause
=
False
ELSE
//Otherwise, initialize the beginning of the stopwatch
ChronoStart
(
1
)
gb
ChronoStarted
=
True
gn
TimerNum
=
TimerSys
(
Timer_Loop
,
50
)
END
Procedure
Timer_Stop
(
)
//Stop the stopwatch
EndTimerSys
(
gn
TimerNum
)
IF
gb
ChronoStarted
=
True
THEN
ChronoEnd
(
1
)
gb
ChronoStarted
=
False
END
//Re-initialization
gdu
TimeNotCounted
=
0
Loc_Timer_Pause
=
False
//EDT_Duration = "00:00:00"
Procedure
Timer_Loop
(
)
du
Duration
is
Duration
//Duration (difference) to display
IF
Loc_Timer_Pause
=
True
THEN
RETURN
END
IF
InternetConnected
(
) =
False
OR
WiFiStatus
(
) =
wifiDisabled
BTN_
0800
..
Visible
=
True
ELSE
BTN_
0800
..
Visible
=
False
END
//Time passed
du
Duration
=
ChronoValue
(
1
)
//Deduces the duration that must not be counted
du
Duration
=
du
Duration
-
gdu
TimeNotCounted
gn
TimerCadastro
+
=
1
IF
gb
TermoUso
=
True
THEN
IF
gn
TimerCadastro
>
1
THEN
gn
TimerCadastro
=
0
aio_HourGlass
(
"Incluindo cadastro..."
)
gb
TermoUso
=
False
ok
is boolean
=
C
adastroConta
(
"Criar"
,
""
)
//info(ok)
IF
ok
=
True
Teclado
(
"Hide"
)
Popup
(
"Cadastro incluido com sucesso"
,
"C"
)
aio_HourGlass
(
""
)
gb
FecharBemVindo
=
True
//ok
gn
Plane
=
1
GloOutrasTelas
=
""
Close
(
)
ELSE
aio_HourGlass
(
""
)
END
END
ELSE
gn
TimerCadastro
=
0
END
--
Adriano José Boller
______________________________________________
Consultor e Representante Oficial da
PcSoft no Brasil
+55 (41) 99949 1800
adrianoboller@gmail.com
skype: adrianoboller
http://wxinformatica.com.br/
Report
0
0
→ Go back to WINDEV 25
WINDEV 25
Français
English
Español
Portuguesa
Close this window
Search type
Only topics
All the messages
Search period
Any time
Past hour
Past 24 hours
Past week
Past month
Past year
Cancel
Preview of your message
Adding an image
Import an image from a URL
Send an image from a file of your disk
Drop a file or click "Browse..."
or
Cancel
0%
WLanguage
SQL
XML, HTML
JAVA, Javascript
Text