FORUMS PROFESSIONNELS
WINDEV
,
WEBDEV
et
WINDEV Mobile
Accueil
|
Messages récents
|
Connexion
|
Déconnexion
|
Français
Accueil
→
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
Débuté par Boller, 22 sep. 2020 12:49 - Aucune réponse
Connectez-vous…
Boller
#1
Membre enregistré
3 657 messages
Popularité : +175 (223 votes)
Posté le 22 septembre 2020 - 12:49
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/
Signaler
0
0
→ Revenir à WINDEV 25
WINDEV 25
Français
English
Español
Portuguesa
Fermer cette fenêtre
Type de recherche
Uniquement les sujets
Tous les messages
Période de recherche
Date indifférente
Moins d'une heure
Moins de 24 heures
Moins d'une semaine
Moins d'un mois
Moins d'un an
Annuler
Aperçu de votre message
Ajouter une image
Importer une image depuis une URL
Envoyer une image depuis un fichier de votre disque
Déposez ici un fichier ou cliquez sur "Parcourir..."
ou
Annuler
0%
WLangage
SQL
XML, HTML
JAVA, Javascript
Texte