Re: [ROOT] compiled variable access in CINT

From: Valeri Fine (fine@bnl.gov)
Date: Tue Nov 20 2001 - 17:03:15 MET


Dear Anton,

I don't think you met here any CINT limitation rather C++ constrains.
Via CINT one can access whatever one  him/herself has added to his/her CINT dictionary
If you want to access the custom global variable MyClass you have to have this global 
variable in you custom dictionary or you have to have some class method  (still in CINT 
dictionary) that returns you this variable.
Of course the first question you should answer is about the scope of the variable "MyClass".
I had assumed it is global one. If it is the local variable then C++ provides you an answer,
namely any object is to be destroyed just the code leaves that object scope and the object 
is not "visible out of its scope. In your case the object is the "TMyClass *"

See CINT documentation how to create CINT dictionary properly.
ROOT code provides plenty of examples of global variables definitions those are available 
via CINT interpreter.


       Hope this helps
                                                Valery

-----
Dr.Valeri Fine
STAR/US Atlas                                    E-mail: fine@bnl.gov
Brookhaven National Lab                     Phone: +1 631 344 7806
Upton, NY 11973-5000                       FAX:     +1 631 344 4206
USA



----- Original Message ----- 
From: "Anton Fokin" <anton.fokin@smartquant.com>
To: <roottalk@pcroot.cern.ch>
Sent: Tuesday, November 20, 2001 8:19 AM
Subject: [ROOT] compiled variable access in CINT 


> Hi rooters,
> 
> a simple question:
> 
> how can I access a compiled variable in CINT (RINT) ?
> 
> TRint Rint(....);
> 
> ...
> 
> TMyClass *MyClass = new TMyClass();
> 
> ...
> 
> Rint.Run(kTRUE);
> 
> This is what I compile and when I run this code I get RINT prompt and I
> would like to access MyClass variable from RINT prompt.
> 
> Is it possible? Probably not...
> 
> Cheers,
> Anton
> 



This archive was generated by hypermail 2b29 : Tue Jan 01 2002 - 17:51:09 MET