Re: [ROOT] for + if + gPad problem?

From: Chris Crawford (ck.crawford@rcn.com)
Date: Thu Sep 23 2004 - 04:52:49 MEST


Hi Victor,
   Thanks!  I replaced gPad with TVirtualPad::Pad(), and it works just 
fine in CINT.
--Chris

Victor Perevoztchikov wrote:

>>> Could anyone please tell me what is wrong with the following little
>>>piece of code?  I am using v4.00/08, linux redhat 8.0.  I'm not sure it
>>>      
>>>
>gPad is not a variable. It is macro.
>#define gPad (TVirtualPad::Pad())
>CINT does not work with macros. For C++ your code is valid.
>Victor
>
>
>
>Victor M. Perevoztchikov   perev@bnl.gov
>Brookhaven National Laboratory MS 510A PO Box 5000 Upton NY 11973-5000
>tel office : 631-344-7894; fax 631-344-4206;
>
>----- Original Message ----- 
>From: "Axel Naumann" <axel-naumann@gmx.de>
>To: "Chris Crawford" <chris2@lns.mit.edu>
>Cc: <roottalk@pcroot.cern.ch>
>Sent: Wednesday, September 22, 2004 5:51 PM
>Subject: Re: [ROOT] for + if + gPad problem?
>
>
>  
>
>>Hi Chris,
>>this is due to cint's loop optimization. .O 0 prevents it.
>>Axel.
>>
>>Chris Crawford wrote:
>>    
>>
>>>Hello,
>>> Could anyone please tell me what is wrong with the following little
>>>piece of code?  I am using v4.00/08, linux redhat 8.0.  I'm not sure it
>>>really has to do with gPad, that's just what I ran across.
>>>--thanks,
>>>Chris Crawford
>>>
>>>{
>>> new TCanvas("cv1","cv1");
>>> for (int x=0;x<2;x++) { //x=1;x<2;x++
>>>   cout<<"gPad1="<<gPad<<endl;
>>>   if (!x) cout<<"gPad2="<<gPad<<endl;
>>>   if (x)  cout<<"gPad3="<<gPad<<endl;
>>> }
>>>}
>>>
>>>
>>>      
>>>



This archive was generated by hypermail 2b29 : Sun Jan 02 2005 - 05:50:09 MET