I have a timer that only starts occationaly someime it´s start´s and sometime its´s not. It´s a orpheus 3 timer. In orpheus 2 it started every time with the same code why?????
code sample:
TimerHandle := AddTimer(ReadTimeout);
repeat
Application.ProcessMessages;
if OkToReadChar then begin
CurrChar := Ord(ReadChar);
if (CurrChar = StartOfRecChar) then
StartFound := true
else
if (CurrChar = EndOfRecChar) then
EndFound := true
else
if StartFound then
S := S + Chr(CurrChar);
end;
{-Check timer.}
if TimesUp[TimerHandle] then
SetError(trmerrReadDataTimeout, 0);
{-Check for userabort.}
if UserAbort then
SetError(trmerrUserAbort, 0);
until EndFound or TimesUp[TimerHandle] or UserAbort;
StopTimer(TimerHandle);
Application.ProcessMessages;
code sample:
TimerHandle := AddTimer(ReadTimeout);
repeat
Application.ProcessMessages;
if OkToReadChar then begin
CurrChar := Ord(ReadChar);
if (CurrChar = StartOfRecChar) then
StartFound := true
else
if (CurrChar = EndOfRecChar) then
EndFound := true
else
if StartFound then
S := S + Chr(CurrChar);
end;
{-Check timer.}
if TimesUp[TimerHandle] then
SetError(trmerrReadDataTimeout, 0);
{-Check for userabort.}
if UserAbort then
SetError(trmerrUserAbort, 0);
until EndFound or TimesUp[TimerHandle] or UserAbort;
StopTimer(TimerHandle);
Application.ProcessMessages;