Issue Checking length of Arguments

Discussion in 'Plugin Development' started by Rmarmorstein, Dec 30, 2012.

Thread Status:
Not open for further replies.
  1. Offline

    Rmarmorstein

    I am trying to make it so that the command will only be successful if there are 2 arguments, args[0] and args[1]. But this is not working for me.

    Here is what i have for the code....

    Code:java
    1.  
    2. if(args.length = 2)
    3.  


    I dont see why that would give an error. The code around it is correct, and the part giving the error is the length. It is telling me No suggestions availible in eclipse. Is there another way to write this? If needed i will give the rest of the code.
     
  2. Offline

    Jogy34

    = is for assignment == is for comparison. You should learn java before trying to make a plugin
     
  3. Offline

    Rmarmorstein

    Jogy34 You dont have to be rude. I tried == and it was still giving me an error. Maybe you should learn to be respectful about peoples questions and help them while being nice.
     
  4. Offline

    Nikok34

    Do you have the code on GitHub? If you don't, would you mind quoting the entire if statement?
    -Nikok34
     
  5. Offline

    Jogy34

    The thing is that == v.s. = is such a basic thing that if you don't know how to use them then you should probably learn more.
     
    GodzOfMadness likes this.
  6. Offline

    Major_Derp

    Sometimes people make mistakes, ive had my fair share of simple mistakes XD
    Rmarmorstein
    And What is the error? And what is the whole containing statement?
     
    MrBluebear3 likes this.
  7. Offline

    Ewe Loon

    and how will he learn with out trying ,
    as a person who has learned over 20 different computer languages I know its an easy mistake to make
    also i type some stuff in directly, and make errors like that simply through now watching the screen as i'm typing

    and your comment was rude !
     
  8. Offline

    Jogy34

    That would be a really bad mistake if he knows what exact line the error is being thrown on and then posted the code to a forum page and still didn't see that he used = instead of ==

    EDIT:
    see above /\ /\ /\

    and about learning without trying, I never said he should try to learn java without trying to code in java. I said he should learn more java before attempting to write a bukkit plugin in java. One of the prerequisites of making a plugin for bukkit is that you have a basic understanding of java
     
    Major_Derp likes this.
  9. Offline

    GodzOfMadness

    I honestly don't know why you think Jogy34 was rude to Rmarmorstein
    All Jogy34 said was to learn some more java before he would go out and make a plugin
    and Rmarmorstein said == was giving him an error so his alternative was =?
    I support Jogy34's post.
     
  10. Offline

    Rmarmorstein

    I was half asleep, and i forgot to save it with the == ...

    it was giving me an error until i saved it, i was derping.

    Also, i just want to say that, yes i did make a mistake, yes it was a stupid one, Yes i do know the difference.... thanks for those that tried to help, and did not argue.

    I also want to add that telling someone to "Learn Java" is not the way to help them learn. If people would help people more and work with them, it would have been a lot easier to solve this.

    ~ A Moderator can please lock this, Solved, and i dont want this to turn into a rage thread ~
     
  11. Offline

    RealDope

    Just wanted to say, been coding for about 2 months. Java is my first language, knew NOTHING about it, jumped right into Bukkit plugins, know my way around pretty well now. Imo plugins are a pretty good way of getting to learn Java.

    The only problem is that everyone who's never coded before comes flying into Java/Bukkit expecting to instantly be able to make the next Essentials or mcmmo or Factions etc..
     
    GodzOfMadness likes this.
  12. Offline

    GodzOfMadness

    if you wan't to see a rage thread:
    http://forums.bukkit.org/threads/pumpkinmachines-looking-for-a-dev-team.117119/
    :p
     
  13. Offline

    NuclearW

    Locked at the request of the OP.
     
    ferrybig and MrBluebear3 like this.
Thread Status:
Not open for further replies.

Share This Page