Page 1 of 1

How to pass parameters to Java program?

Posted: Wed Oct 18, 2006 8:14 pm
by kaniseth
Hi,
I can successfully compile and run programs that don't require any arguments to be supplied, but how to I pass parameters / arguments to the program.

On the command line I can type: " java GetDaysInMonth October " and my program would output 31, so how do I pass the 'October' in textpad?


Thank you

Posted: Wed Oct 18, 2006 9:15 pm
by talleyrand
If it is always October, then you can alter the tool (via Config, Pref, Tools) but I suspect you'd like to be able to pass in dynamic content. In that case, I believe you're going to be out of luck unless something in the Tool Parameter Macros will be of assistance (see the help menu) Perhaps $prompt will work but I've never experimented with them.

It works!

Posted: Thu Oct 19, 2006 2:13 pm
by kaniseth
Adding ' $prompt ' after ' $BaseName ' in the parameters field on run java application works!!

Thank you :o