Don't you have a type Iter instead of TIter? This works:
//--- a1.C
main()
{
TIter next(gDirectory->GetListOfKeys());
TKey *k;
while (k = (TKey *)next()) {
k->Print();
}
}
.L a1.C
main()
Cheers, Fons.
Luca Sfarzo wrote:
>
> Hello,
>
> I am writing a Macro using CInt with a main and some functions in it.
> Well, when I write
>
> root [9] .L prog.c
> root [10] main()
>
> to call the main method all goes in the good way up to a point where it
> says
>
> Error: No symbol next() in current scope
> FILE:/tmp_mnt/disk1/localuser/sfarzo/root/brows/OK/./progcint.c LINE:55
> *** Interpreter error recovered ***
>
> line 55 is the body of a well declared function of my macro where it
> says
> ..
> 54. Iter next(gDirectory.GetListOfKeys());
> 55. while (key = (TKey*) next()) {
> ..
> To make the situation even more confused I put my function run "stand
> alone' and all worked fine.
>
> So am I to include somethin special when I try to use CINT to run my
> function in a c++ macro with a main() and some functions in it or am I
> to include something when I try to use Iterator under CINT.. or what
> else?
>
> Thanks, Luca Sfarzo
-- Org: CERN, European Laboratory for Particle Physics. Mail: 1211 Geneve 23, Switzerland Phone: +41 22 7679248 E-Mail: Fons.Rademakers@cern.ch Fax: +41 22 7677910