PC SOFT

PROFESSIONAL NEWSGROUPS
WINDEVWEBDEV and WINDEV Mobile

Home → WINDEV Mobile 2024 → Example Multi Thread
Example Multi Thread
Started by adrianoboller, Nov., 20 2014 10:06 PM - 9 replies
Registered member
3,659 messages
Popularité : +175 (223 votes)
Posted on November, 20 2014 - 10:06 PM
....
IF gbThreadAtivada = False THEN
gbThreadAtivada = True
IF ThreadState(loopthread) = threadUnknown THEN

ThreadExecute(loopthread,threadNormal,WS_MultiThread_Loop)

END
END
.....
Registered member
3,659 messages
Popularité : +175 (223 votes)
Posted on November, 20 2014 - 10:06 PM
Procedure WS_MultiThread_Loop()

WS_MarcadorDadosCorrida()

gbThreadAtivada = False
Registered member
3,659 messages
Popularité : +175 (223 votes)
Posted on November, 20 2014 - 10:07 PM
Procedure WS_MarcadorDadosCorrida()

ok is boolean = False

IF gloNumCorrida > 0 THEN

ok = WS_Taxi_ConsultarCorrida(gloNumCorrida,"")

IF ok = True

ok = WS_Taxi_ConsultarPosicao(gloNumCorrida,"")

END

END
Registered member
3,659 messages
Popularité : +175 (223 votes)
Posted on November, 20 2014 - 10:09 PM
// The first code posted it should be running on an equal Timer Clock example that comes along with Windev Mobile.

//No primeiro codigo postado o mesmo deve estar sendo executado sobre um timer igual do exemplo Clock que vem junto com o Windev Mobile.
Registered member
3,659 messages
Popularité : +175 (223 votes)
Posted on November, 21 2014 - 1:29 PM
Procedure Timer_Break()

//Suspend the stopwatch
gbPause = True

//Time the time passed that must not be counted
ChronoStart(2)
Registered member
3,659 messages
Popularité : +175 (223 votes)
Posted on November, 21 2014 - 1:30 PM
Procedure Timer_Loop()

duDurationis Duration //Duration (difference) to display

IF gbPause THEN
RETURN
END

//Time passed
duDuration = ChronoValue(1)

//Deduces the duration that must not be counted
duDuration = duDuration - gduTimeNotCounted

//------------------------------------------

//You code....................... HERE!!!!!
Registered member
3,659 messages
Popularité : +175 (223 votes)
Posted on November, 21 2014 - 1:30 PM
Procedure Timer_Play()

//If there is a start time for the stopwatch, it means that time calculation resumes after a stop
IF gbPause THEN

//Duration not to count in milliseconds (it is a cumulated duration for all the stops performed)
duDuration is Duration = ChronoEnd(2)
gduTimeNotCounted += duDuration
gbPause = False

ELSE

//Otherwise, initialize the beginning of the stopwatch
ChronoStart(1)
gbChronoStarted = True
gnTimerNum = TimerSys(Timer_Loop,20)

END
Registered member
3,659 messages
Popularité : +175 (223 votes)
Posted on November, 21 2014 - 1:30 PM
Procedure Timer_Stop()

//Stop the stopwatch
EndTimerSys(gnTimerNum)

IF gbChronoStarted = True THEN
ChronoEnd(1)
gbChronoStarted = False

END

//Re-initialization
gduTimeNotCounted = 0
gbPause = False

//EDT_Duration = "00:00:00"
Posted on March, 11 2016 - 8:39 PM
Can I use this to run a thread that when the app is minimized can also read NFC tags? I got the following code but it doesn't work

Code of project initialization
ThreadExecute("NFC_Reader",threadGlobalContext,ReadTag)
Notif is Notification
Notif..ActivateApplication = True
Notif..Title = "Modo de lectura de NFC..."
ThreadPersistent("NFC_Reader",Notif)

PROCEDURE ReadTag()
Info("leer")
tag is nfcTag
tag = NFCReadTag()
IF NOT ErrorOccurred THEN
//Info(StringBuild("Reading a NFC tag of %1 type", tag..Type))
FOR EACH data OF tag..Data
SWITCH data..Content
CASE "WiFi"
IF WiFiStatus() THEN
WiFiActivate(False)
ELSE
WiFiActivate(True)
END
END
END
END

Not even the Info in the procedure is showing, and the thread persistent returns true
Registered member
3,659 messages
Popularité : +175 (223 votes)
Posted on August, 28 2017 - 3:46 PM
HCS.Timeout & HCS.FrameSize
Um variável HCS.Timeout é usado para modificar o tempo limite de conexão:
Para como conexões estabelecidas pelo HOpenConnection.
Para como aberturas de conexão automática.
Nota: Um variável HCS.Timeout é ignorado para os acessos ao servidor que não é uma conexão. Um pedido de execução é maior DO que o valor específico na variável HCS.Timeout não seria interrompida, por exemplo. Esse tempo limite deve ser especificado No aplicativo cliente, antes que seja uma conexão aberta sem servidor.
Exemplo

HCS.Timeout = INTRANET

Um variável HCS.FrameSize é usado para redimensionar o quadro de dados de saída. Em alguns casos, o redimensionamento dos quadros pode ser usado para adaptar o fluxo de dados de saída e de entrada aos desempenhos DO hardware usado. Por exemplo, se uma conexão entre os computadores e o cliente HFSQL Client / Server para através de redes de configuração (placa de rede, SWITCH, roteador, vpn, ...)

HCS.FrameSize = hInternetFrame


--
Adriano José Boller
______________________________________________
Consultor e Representante Oficial da
PcSoft no Brasil
+55 (41) 99949 1800
adrianoboller@gmail.com
skype: adrianoboller
http://wxinformatica.com.br/