> Error: Function passParameters("parameter1","parameter2") is not defined in current scope
Indeed!
Replace the name of the function.
Instead of your
> int main(int argc, const char **argv)
use
void passParameters(const char * par1, const char *par2, ...)
You can use any other types (int , double, float, ... ) for your parameters too.
You can do everything in one shot:
root.exe -q 'passParameters.C+("parameter1","parameter2")'
Watch 'single' and "double "quotation above.
Hope this helps, Valeri
From: owner-roottalk_at_root.cern.ch on behalf of seforo mohlalisi
Sent: Wed 5/28/2008 8:31 AM
To: roottalk_at_cern.ch
Subject: Re: [ROOT] argc argv
But then when I do that I get an error that Error: Function passParameters("parameter1","parameter2") is not defined in current scope
Regards,
Seforo Mohlalisi
Cell: +27 79 226 3682
Emails: seforo_at_gmail.com seforomohlalisi_at_yahoo.co.uk
From: Nitesh Soni <ns_at_hep.ph.bham.ac.uk> Subject: Re: [ROOT] argc argv To: "seforo mohlalisi" <seforomohlalisi_at_yahoo.co.uk> Cc: roottalk_at_cern.ch Date: Wednesday, 28 May, 2008, 3:20 PM HI Seforo,
> I have a file named passParameters.cxx and in it main function is defined
> int main(int argc, const char **argv)
> {
> //code goes here
> }
> I can generate an executable passParameters with g++ and run as follow:
> ./passParameters parameter1 pameter2 .. parametern
>
> How can I achieve this with ROOT?
> I can compile as
> root[0].L passParameters.cxx+
> Then how do I pass the
parameters? Probably, you can do the following: root[0].L passParameters.cxx root[0]passParameters("parameter1","parameter2",....); cheers, -Nitesh ________________________________
Sent from Yahoo! Mail <http://us.rd.yahoo.com/mailuk/taglines/isp/control/*http://us.rd.yahoo.com/evt=52418/*http://uk.docs.yahoo.com/nowyoucan.html> . A Smarter Email. Received on Wed May 28 2008 - 15:25:13 CEST
This archive was generated by hypermail 2.2.0 : Wed May 28 2008 - 23:50:02 CEST