To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.robotics.rcx.nqcOpen lugnet.robotics.rcx.nqc in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / RCX / NQC / 1049
1048  |  1050
Subject: 
Re: Yet another Q: IR messages
Newsgroups: 
lugnet.robotics.rcx.nqc
Date: 
Sat, 31 Mar 2001 01:05:45 GMT
Viewed: 
2421 times
  
In lugnet.robotics.rcx.nqc, Tobias Möller writes:
Thanks for the information so far.

Is there any NQC command similar to the RCX-code "wait until message"-block?

--Tobias

Hi Tobias

I'm not very familiar with NQC events, but if you want to use a blocking
function for receiving your message, use parts of the code i posted before.


int local_message = 0;
int global_message = 0;

task main()
{
   //do what you like

   ClearMessage();
   while (!local_message)          // leaves only if message received !!
   {
      local_message = Message();   // stores message local
      Wait(10);                    //don't know if neccessary ? Try out !
   }
   ClearMessage();                 // Cleares receive buffer
   global_message = local_message; // stores message global
   local_message = 0;              // reset local_message for receiving next

                                   // do what you like after receiving any
                                   // message (in global_message)
}

Rainer



Message is in Reply To:
  Re: Yet another Q: IR messages
 
Thanks for the information so far. Is there any NQC command similar to the RCX-code "wait until message"-block? --Tobias (24 years ago, 30-Mar-01, to lugnet.robotics.rcx.nqc)

6 Messages in This Thread:




Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR