Re: macro problem

Canguo Li (licg@hpws7.ihep.ac.cn)
Thu, 3 Dec 1998 20:40:09 +0800 (EAT)


On Thu, 3 Dec 1998, Dr. Roberto Barbera wrote:

> Hi experts,
>
> I've modified the tutorial macro basic.C to read an ASCII file
> containing several lines of 12 elements each (3 integers and 9 reals).
> Here is the macro i'm using:

> ncols = fscanf(detfile,"%i %i %i %f %f %f %f %f %f %f %f
> %f",
> &ilayer,&iladder,&idet,&f1,&f2,&f3,&f4,&f5,&f6,&f7,&f8,&f9);

> and this is what i get when i run the macro inside ROOT:
>
> root [0] .x readet.C
> Reading Detector Map from file...
> Limitation: fscanf only takes upto 12 arguments

I tried your example. If you reduce items to read from 12 to 10, then
it works. fscanf() obviously takes the file descriptor and format as 2
arguments.

The question how to read in more than 10 items remains answered.

regards

--Canguo