File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Help on Java modifications

 
Troy Johnson
Greenhorn
Posts: 20
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello. I am working on the following Java problem. I am making two modifications to the program. The first is to Ignore cases, which I have completed. The second is to Use a command-line argument. Could anyone offer any suggestions on using a command-line argument with this program. Thanks.

[ October 11, 2003: Message edited by: Troy Johnson ]
[ October 11, 2003: Message edited by: Troy Johnson ]
 
Joel McNary
Bartender
Posts: 1824
Eclipse IDE Java Ruby
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Command-Line arguments are easy to use. Take a look at the signature for the main method:

That String array is where you receive your parameters.
(As I learned in C, I call it argv[], instead of args...)
So, the length of this array will tell you how many parameters there are, and each parameter receives its own spot in the array.
Note that, unlike in C, the program name is not passed in here. The first parameter really is the first parameter.
 
Michael Dunn
Ranch Hand
Posts: 4632
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try this
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic