I wan to check for incoming data from the PC at certain interval if no data is available move forward to other functions so i wrote a function for getting charater getcharX() for some reason it dose not seem o work. Please Let me know what i'm doing wrong or what are the alternatives this is the code i used j=0; while(( out[j] = getCharX())!=0xff && j <= 3) { j++; } if(out[0]=='X') goto Now; goto start; ----------------------------------------------------------- char getCharX() { char c; int i=0; while(!RI) { i++; if(i==2) return 0xff; } c = SBUF; RI = 0; return (c); }