listenForIR(); blocks whole program

Hello!

I am trying to program an IR remote controlled multiplexed 7 digit 7-segment-display
The multiplexed Display is working well with some 595s but my problem is: when i start the function listenForIR(); the whole multiplex program seems to stop and the arduino is only waiting for an IR signal and not doing anythinig else. i am using delay(); and not millis();
Is there a way to run these two programs parallel, or to make something like a for or while function? and what is the code for ending the listenForIR(); function? return;???

all help will be appriciated!

Is this listenForIR() The ladyada one?

Its written in a blocking style by the look of it. Given the timing constraints it would be hard to interleave other code with it, but if it had a timeout value added you could arrange for other code to run after it timed out. (This would be at the expense of occasional missed IR packets).

A better approach is to re-write it as an interrupt handler.