Forums Register Login

Argument, passing a textfile

+Pie Number of slices to send: Send
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
+Pie Number of slices to send: Send
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.
+Pie Number of slices to send: Send
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.
Without deviation from the norm, progress is not possible - Zappa. Tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 3589 times.
Similar Threads
Having trouble with GUI program for mortgage calculator
Getting output to work
Evaluating Postfix Expression
reusult of this a = a + a++;
Getting input with instructor code isn't working as I would expect...
More...

All times above are in ranch (not your local) time.
The current ranch time is
Apr 16, 2024 00:59:13.