301 Subj : Re: Warning question To : borland.public.cpp.borlandcpp From : Danzer Date : Sat Feb 05 2005 12:00 pm dkat wrote: > > AnsiString TMainForm::CheckString(AnsiString String) > { > AnsiString TempString; > int d = 0; > > if(String=="")return String; > TempString = String; > > char* cp= new char[ TempString.Length() + 1 ]; > strcpy( cp, TempString.c_str() ); > for( int s=0;s<=TempString.Length();++s) > if(cp[s] < '0' || cp[s] > '9') > {TempString.Delete(s+1-d,1); ++d; } > if(cp)delete cp; > return TempString; > } > I copied this exact code into a project of mine that has a form named MainForm. I got no warning message about the value assigned to d never being used. BCB 6.0 build 10.166. . 0