How to pass parameters to Java program?

Using the Java SDK with TextPad

Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard

Post Reply
kaniseth
Posts: 4
Joined: Wed Oct 18, 2006 8:10 pm

How to pass parameters to Java program?

Post 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
User avatar
talleyrand
Posts: 624
Joined: Mon Jul 21, 2003 6:56 pm
Location: Kansas City, MO, USA
Contact:

Post 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.
I choose to fight with a sack of angry cats.
kaniseth
Posts: 4
Joined: Wed Oct 18, 2006 8:10 pm

It works!

Post by kaniseth »

Adding ' $prompt ' after ' $BaseName ' in the parameters field on run java application works!!

Thank you :o
Post Reply