[ROOT] TString

From: giuseppe.foggi@libero.it
Date: Mon Dec 02 2002 - 09:11:37 MET


Hi rooters,
 I have a problem with Append method of TString.
 So this is a subset of my script:
 
 ......................
 s.ReadLine(metricvalue,kFALSE);
 TString *v=new TString((Int_t)s.Index(' '));
 pos=(Int_t)s.Index(' ');
 v->Append(s.Data(),pos);
 while(((v->Data())!=fMetric[indd])&&(!metricvalue.eof())) 
 {
   delete v;     
  
   appfile.write(s.Data(), s.Length());
   appfile<<'\n';
   s.ReadLine(metricvalue,kFALSE);
   pos=(Int_t)s.Index(' ');
   if (pos>0)
   {
	TString *v=new TString((Int_t)s.Index(' '));
	v->Append(s.Data(),pos); //In this point I have the problem!!!!!!
   }
   else  TString *v=new TString("XXXX");
	     
 } 
 
 .....
 
 The instruction v->Append(s.Data(),pos) within the body of "if" gets me
 a empty TString or a TString with random character. 
 Can somebody tell me why???
 
 There are some other method to copy a subset of character of a TString
 to another TString?
 
 I tried with
 
 TString s("giuseppe foggi")
 TString *p= new TString(s,s.Index(' '))
 
 so I get the same result!
 
 Cheers.
 
 Giuseppe Foggi.
 
 
 
 



This archive was generated by hypermail 2b29 : Sat Jan 04 2003 - 23:51:22 MET