How to run macro in batch mode with additional variables?


I would like to run a macro in the batch mode using some parameters.
My macro MyMacro.C contain the main function with the same name (i.e. void MyMacro()) and running with “root MyHisto.C MyMacro.C -b -q” in batch mode on a histogram MyHisto works fine.
But is there a way to run it in batch mode when I define the main function as

and I want to handle somehow parameters in the batch call? Something maybe like “root MyHisto.C MyMacro.C(42,“foo”) -b -q” (which does not work :cry: ) – in the interactive mode it works of course to load the macro and start the main function with some input.

Cheers & Thanks for ideas,

see examples in the Users Guide: Getting Started manual
pages 1 and 2