RE: [ROOT] Executing a loaded method

From: Philippe Canal (pcanal@fnal.gov)
Date: Tue Nov 25 2003 - 16:55:23 MET


Hi Martijn,

This is strange.

> The problem is that gROOT->ProcessLine() does not work:
It should work (especially in your case).  It should not mention TFile in
case of failure.  Can you be more explicit about:
	- the actual argument to ProcessLine
	- the actual error message.

> Yet this can only work as long as my program remains interpreted.
More accurately, it will require your symbol to be exposed to CINT
(they could be either compiled or interpreted).

> I could execute it directly with arguments, in
> both interpreted mode and compiled mode.
As long as your properly exposed the symbols (generate the dictionary)
gROOT->ProcessLine is your easiest and most flexible way of handling
this (but there is several other possibilities).

Cheers,
Philippe

-----Original Message-----
From: owner-roottalk@pcroot.cern.ch
[mailto:owner-roottalk@pcroot.cern.ch]On Behalf Of Martijn Schellekens
Sent: Tuesday, November 25, 2003 3:47 AM
To: roottalk@pcroot.cern.ch
Subject: [ROOT] Executing a loaded method


Hi rooters,

I am developing some user interface in which users can apply some simple
macro (either compiled or interpreted) to several events. I first load this
Macro with gROOT->LoadMacro() so it is not loaded several times (with
related warnings). Then I would like to execute the main method (with the
same name) with some arguments comming from my user interface program. The
problem is that gROOT->ProcessLine() does not work: it seems to open some
new temporary TFile in which my arguments (although my program is mainly in
interpreted mode) are not recognized. The only solution that I see
currently is making a new macro file on the fly in which resides only the
call to my function with corresponding arguments. Yet this can only work as
long as my program remains interpreted. What I would like to do is get back
my method (which is not a class method) from some TCollection (yet I didn't
find which one) where from I could execute it directly with arguments, in
both interpreted mode and compiled mode.

Could someone help me on this,

Best regards,

Martijn Schellekens



This archive was generated by hypermail 2b29 : Thu Jan 01 2004 - 17:50:17 MET