[java programming] Re: command line arg

2009-02-09 Thread mcmcalex
I think the OP was asking 'how do i pass arguments to main() in JCreator?' As miga said, there will be JCreator info out there (eg http://www.jcreator.com/faq.htm), but this isn't the place. The code is fine as it is. On Feb 10, 2:00 am, Żukowski Michał wrote: > Hi > > Yes Maciej you're right,

[java programming] Re: command line arg

2009-02-09 Thread Żukowski Michał
Hi Yes Maciej you're right, my mistake ;) I have another idea: > if(args.length() == 0) > System.exit(0); Maybe there was () missing, because args.length() is a method?? But in this case compiler would signal that probably. -- Best regards Michal Zukowski 2009/2/9 Maciej Myrcha : > Wita

[java programming] Re: command line arg

2009-02-09 Thread Żukowski Michał
Well, I figured out that the goal is to print to the screen the values passed from the command line. So first you check if there are any with > if(args.length == 0) If there are no valuse args.lenth is null and the program should terminate > System.exit(0); But if args.length is not equall to

[java programming] Re: command line arg

2009-02-09 Thread Maciej Myrcha
Michal, the structure in Stephen's example is quite ok, it seems that there are problems with args. Stephen try to print args length first like System.out.println("args length " + args.length); instead of System.out.println("I am saying Hello to the people below.. "); and see if it is equal to 0

[java programming] Re: command line arg

2009-02-09 Thread Żukowski Michał
Hi The problem is with your code not your IDE. Thit if statement structure is incomplete and missing "else" part :) > if(args.length == 0) > System.exit(0); > else > { > for(int counter = 0; counter < args.length; counter++){ > System.out.println("argument index " + cou

[java programming] Re: command line arg

2009-02-07 Thread miga
On Feb 3, 9:00 pm, Stephen Adjei wrote: > I dont get the command line args well. I know when u pass an argument,it is > passed through an array of string like this ;   > public static void main( String[] args ) >  but i used  JCreater to run this and it compiled well and ran but printed > out