Hello,
I have a routine that reads a socket every x seconds. Each read statement put the result in the It variable. Beside that there are user interactions that may lead to using the read socket command as well. In that scenario I have a "chance" to get a value in the It variable that is not the one that is expected. Is there a way to have the read command returning the result in another variable?
Thank you
Use of It in concurrent processes
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Use of It in concurrent processes
Nicolas
LC 7.1 on Windows 8.1 and on MAC OS 10.10.5 Xcode 6.4 - 7.1
LC 7.1 on Windows 8.1 and on MAC OS 10.10.5 Xcode 6.4 - 7.1
Re: Use of It in concurrent processes
Hi kolia,
But you should put IT into another variable IMMEDIATELY after getting IT!
That is the only way to prevent this kind of inconvenience.
Best
Klaus
no!kolia wrote:Is there a way to have the read command returning the result in another variable?
But you should put IT into another variable IMMEDIATELY after getting IT!
That is the only way to prevent this kind of inconvenience.
Best
Klaus
Re: Use of It in concurrent processes
This indeed what I do. But I found a trick: I use the peerAddress of host:port command that returns "not an open socket" in case the device is free.
Nicolas
LC 7.1 on Windows 8.1 and on MAC OS 10.10.5 Xcode 6.4 - 7.1
LC 7.1 on Windows 8.1 and on MAC OS 10.10.5 Xcode 6.4 - 7.1
Re: Use of It in concurrent processes
Hi,
Glad you found a workaround.
Now do what Klaus said. Always, always put the value of "it", however obtained (answer dialog, read..., convert, whatever) into another variable right away. You will be glad you did.
Craig Newman
Glad you found a workaround.
Now do what Klaus said. Always, always put the value of "it", however obtained (answer dialog, read..., convert, whatever) into another variable right away. You will be glad you did.
Craig Newman