Yes,
If your macro defines some "subroutine" let say MyTest and the name of
the file match the name of the subroutine:
MyTest(char *letters, int number){
. . .
}
then you can call it
>root 'MyTest.C("mytest",34)'
etc.
see: ftp://root.cern.ch/root/Users_Guide_3_2c.pdf, page 93.
(it seems to me it does miss to mention one can start ROOT macro from
the shell directly)
On other hand you can use TApplication::Argc(),TApplication::Argv()
to provide your custom action as well.
(see: http://root.cern.ch/root/htmldoc/TApplication.html )
Hope this helps, Valeri
> -----Original Message-----
> From: owner-roottalk@pcroot.cern.ch
[mailto:owner-roottalk@pcroot.cern.ch]
> On Behalf Of Kay Ulbrich
> Sent: Friday, April 04, 2003 11:10 AM
> To: roottalk@pcroot.cern.ch
> Subject: [ROOT] main(int argc, char **argv) - Syntax in macros
>
> Hello,
>
> in a ROOT-Macro I want to use the main(int argc, char **argv) -
> Syntax/Mechanism in order to pass a variable list of arguments to a
> function defined in the macro. I did not find a way to so (I could --
> of course -- hard link the code, but that's what I do want to avoid).
>
> Is there an easy mechanism with ROOT/cint to pass an argument list as
> described above or something similar?
>
> Thank you for help and suggestions,
> Kay
>
> --
> ======================================================================
> Kay Ulbrich
> Helmholtz-Institut fuer
> Strahlen- und Kernphysik
> der Universitaet Bonn Tel.: +49-228-73 1768
> Nussallee 14-16 Institute FAX: +49-228-73 2505
> D-53115 Bonn, Germany E-mail: ulbrich@iskp.uni-bonn.de
> ======================================================================
>
>
>
This archive was generated by hypermail 2b29 : Thu Jan 01 2004 - 17:50:10 MET