Greetings all,
I am trying to write a simple script to read file names from a list file, but I can’t get the syntax correct.
My attempt at the script is just
{
TTree *T = new TTree("DataFile","input file names from list");
nlines = T->ReadFile("Input_files.txt","filename");
printf(" found %d lines\n",nlines);
T->GetEntry(0);
TString Qqqq = T->GetLeaf("filename")->GetValue(0);
printf(" filename is %s \n",Qqqq);
}
And the list I am trying to read just contains three entries
[quote]XZXYZ1
XZXYZ2
XZXYZ3[/quote]
The error messages I get are as follows:
[quote]root [1] .x Read.C
found 0 lines
Error: Ambiguous overload resolution (10000,2) C:\Fit_test_folder_ru98\Read.C(6)
Calling : TString::TString(Double_t);
Match rank: file line signature
ffffffff (compiled) 0 TString TString::TString(const TSubString&);
ffffffff (compiled) 0 TString TString::TString(char,Ssiz_t);
- 10000 (compiled) 0 TString TString::TString(char);
ffffffff (compiled) 0 TString TString::TString(const string&);
ffffffff (compiled) 0 TString TString::TString(const char*,Ssiz_t);
ffffffff (compiled) 0 TString TString::TString(const char*);
1000001 (compiled) 0 TString TString::TString(const TString&); - 10000 (compiled) 0 TString TString::TString(Ssiz_t);
ffffffff (compiled) 0 TString TString::TString();
ffffffff (compiled) 0 TString TString::TString(const char*,Ssiz_t,const char*,Ssiz_t);
*** Interpreter error recovered ***[/quote]
Any guidance you can give on what is wrong with my script would be greatly appreciated. Eventually I will want to loop through the file names, but for now I just want to read the first one in the list.
Regards