Help With Request Que Logic
samos
Posts: 106
OK, I have been writing code for about 2 days and I just wanted to see if anyone else has an idea on how to create the logic for this problem. I have 40 mics in a system. The mics have a button that sends a request to talk string to my NI and a kill request when pushed agian. As I receive the strings for requests I add the mic number to the end of an integer array. My question is when I recieve commands to kill a request what is the best way to search the integer array to find the location in the request que that the mic is at and remove it from the array. any help would be great thanks.
0
Comments
Here is some example code for 10 mics - I?m too lazy to type out 40 numbers. This example uses TP buttons to select or kill a mic.
HTH
Joe,
Thanks for the reply but I need to know the order in which the mics were pressed. The room is a meeting room for a State Senate building. I have on my touch screen buttons with each senators name and the ability to turn on or off any mics. They have asked for a button that will give the floor to the next senator in the que. so that the floor will be givin to the first senator how asks for the floor.
Don't know if that gets you any closer to what you're looking for, and it doesn't yet take into account what to do if the mic is listed more than once, but you're probably already handling that in the Add_to_Queue portion of your program I would suppose.
That is a great idea i appreciate your help. i think that is exactly what I need. I had created a char array and passed in the mic number and a break char ':' I then did a find string for example
if(find_string(data.text,'23:',1))
then remove it but I knew that I could do it with a integer array
Keep posting!
Sleepless in Saint Charles?