Hi Kay,
I do something along the following lines:
#ifndef __CINT__
#include <TROOT.h>
#include <Rtypes.h>
#include <TString.h>
#endif
#ifdef __CINT__
// This part is used in the interpreter, e.g.:
// root
// .L mymacro.C
// mymacro("bla0","bla1")
void mymacro(TString str0,
TString str1)
{
#endif
#ifndef __CINT__
// This is used when being compiled
int main(Int_t argc, Char_t **argv)
{
TString str0 =...
TString str1 =...
#endif
// your program
}
> X-Authentication-Warning: pcroot.cern.ch: majordomo set sender to
owner-roottalk@root.cern.ch using -f
> From: Kay Ulbrich <ulbrich@iskp.uni-bonn.de>
> MIME-Version: 1.0
> Content-Transfer-Encoding: 7bit
> Date: Fri, 4 Apr 2003 18:09:35 +0200
> 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
> ======================================================================
>
>
>
Eddy A.J.M. Offermann
Renaissance Technologies Corp.
Route 25A, East Setauket NY 11733
e-mail: eddy@rentec.com
http://www.rentec.com
This archive was generated by hypermail 2b29 : Thu Jan 01 2004 - 17:50:10 MET