Re: executing one macro from another

From: Marco van Leeuwen (mvl@nikhef.nl)
Date: Sun Mar 26 2000 - 12:24:52 MEST


Hi Rutger,

You could probably use gROOT->LoadMacro() succesfully (or was it
gSystem->LoadMacro()).  This has the disadvantage that the second macro
has be contained in a function, and therefore some results maybe lost in a
local scope.

Kind regards,

Marco van Leeuwen.

On Sat, 25 Mar 2000, Rutger van der Eijk wrote:

> Hi,
> 
> I want to execute one macro from another macro. In this way a 'top macro'
> can configure the job. But I can't get it to work.
> 
> Example:
> 
> --------- macro topMacro.C
> {
> 
>    gInterpreter->ExecuteMacro("subMacro1.C");
>   
> }
> --------- subMacro1.C
> {
>  // do something
> }
> 
> 
> 
> If I do (within RINT):
> 
> .x topMacro.C
> 
> I get something like:
> 
> Error: file subMacro1.C can not open
> 
> I tried various things in topMacro.C:
> 
> 1) gInterpreter->ExecuteMacro("subMacro1.C");
> 2) gInterpreter->Processline(".x subMacro1.C");
> 
> In understand this somehow means a recursive use of interpreter. But I
> think it must be possible somehow (I think I remember the Alice ppl
> do things like that.) What is the right procedure to get this to work?
> 
> Thanks,
> 
> Rutger van der Eijk
> 
> 
> 



This archive was generated by hypermail 2b29 : Tue Jan 02 2001 - 11:50:22 MET