If (FormMain - & gt; TomTomFlag) {
If (ApdComPort - & gt; The Open) {
Memo - & gt; Lines - & gt; Add (" free ApdComPort ");//add print information
ApdComPort - & gt; The Open=false;
}
The else
{
Memo - & gt; Lines - & gt; Add (" ApdComPort is close ");
}
}
//determine whether closed again
If (ApdComPort - & gt; The Open) {
Memo - & gt; Lines - & gt; Add (" free ApdComPort again ");
ApdComPort - & gt; The Open=false;
}
The else
{
Memo - & gt; Lines - & gt; Add (" ApdComPort is closed check ");
}
But sometimes will print free ApdComPort and free ApdComPort again, namely ApdComPort couldn't succeed,
But this isn't a appear, sometimes programs run more than a dozen two times will appear only once,
Excuse me each great god what is this situation,
CodePudding user response:
Judge again, before the appropriate time delay, may equipment are closing in, you give him some time,