492 Subj : Re: Warning question To : borland.public.cpp.borlandcpp From : dkat Date : Fri Feb 04 2005 04:29 pm Sorry - that code doesn't exist - It didn't get taken out when I cut and paste and then made changes (so I tried initializing two different ways first int d; d=0; and then int d=0; //with no following initializing. "Danzer" wrote in message news:420397c5$1@newsgroups.borland.com... > dkat wrote: > > > //why do I get this warning- > > > > //[C++ Warning] GlazeFormulation.cpp(812): W8004 'd' is assigned a value > > that is never used > > > > //On this code > > > > //-------------------------------------------------------------------------- - 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; } > Both assigments to d are not needed. . 0