Subj : Re: Why does this work sometimes? To : borland.public.cpp.borlandcpp From : "Dennis Jones" Date : Wed Jan 14 2004 07:59 pm "Base8" wrote in message news:4005e476$1@newsgroups.borland.com... > Can anyone clue me in on why the if( ) statement included at the bottom > works sometimes but doesn't other? Any thoughts appreciated. > > > > int ErrorProcessing(int code) > { > char *OUTPUTERR ; > char *OUTPUTTYPE ; > int sendback = 0 ; > > switch(code) > { > case 120: > { OUTPUTERR = "Service ready in nnn minutes." ; > OUTPUTTYPE = "Information" ; > break ; > } > case 553: > { OUTPUTERR = "Requested action not taken." ; > OUTPUTTYPE = "Error" ; > sendback = -1 ; > break ; > } > default: > { OUTPUTERR = "Unknown Error" ; > OUTPUTTYPE = "Unknown Type" ; > sendback = -1 ; > break ; > } > } > if(sendback != 0) > MessageBox(0,OUTPUTERR, OUTPUTTYPE, MB_OK) ; > > return sendback ; > } > Uh, because sometimes "code" is equal to 120, and sometimes it's not? - Dennis .