Posted 24 January 2014 - 06:46 AM
Hello!
I have a problem with a while loop. I want the program to be stuck at that loop untill it get the message "fardiga" from computer with channel 1.
As I have programmed it now it breaks the loop as soon anything is sent to the computer. I know how and works but not when I start adding not condition to it.
Can anyone help with the right conditons and why this loop seems to let everything throu it.
I have a problem with a while loop. I want the program to be stuck at that loop untill it get the message "fardiga" from computer with channel 1.
As I have programmed it now it breaks the loop as soon anything is sent to the computer. I know how and works but not when I start adding not condition to it.
Can anyone help with the right conditons and why this loop seems to let everything throu it.
function getInfo()
_, side, freq, rfreq, message = os.pullEvent("modem_message")
end
getInfo()
while rfreq ~= 1 and message ~= "fardiga" do
getInfo()
end