File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes Argument, passing a textfile Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Argument, passing a textfile" Watch "Argument, passing a textfile" New topic
Author

Argument, passing a textfile

Keshan Pillay
Greenhorn

Joined: May 21, 2008
Posts: 29
Hey everyone! I have to make a postfix calculator, and I think i'm pretty sorted as to the code for it. However, something that confuses me is:



I use textpad to do my editing, compiling etc. I've been told I need to pass a textfile, as an argument? Or I'm just confused... How do I do this? I think its something to do with run parameters.

Many Thanks
Keshan Pillay
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 36453
    
  15
Difficult to be sure, but I think it might refer to a command line argument. You write

java PostfixCalc "1 2+ 3*"

The structure of your main method requires the "" otherwise it would only recognise 1. You cannot join the arguments together and maintain postfix nomenclature, otherwise it would read 12+3* or 123+4* which is ambiguous.
Keshan Pillay
Greenhorn

Joined: May 21, 2008
Posts: 29
Thanks for the reply! I got it sorted! turns out I had to make a file I/O method, because the calculations were in a text file, and then pass the textfile as an argument through the command prompt.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Argument, passing a textfile
 
Similar Threads
Getting output to work
Having trouble with GUI program for mortgage calculator
Getting input with instructor code isn't working as I would expect...
reusult of this a = a + a++;
Evaluating Postfix Expression