Results 1 to 3 of 3
  1. #1
    Zertacus is offline Member
    Join Date
    Jan 2013
    Posts
    3
    Rep Power
    0

    Question Make 1 Variable demand 2 things ? - (Example ; Variable=1 && 2 )

    Hello !


    I am making a calculator and I have to know how to make a Variable demand 2 things,

    etc

    if(MetodCheck=1 && 2){
    then begin doing the code
    }

    Just to clarify, MetoCheck is requiring both 1 and 2 to be "active?" to continue the code.

    Thanks <3

  2. #2
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,437
    Blog Entries
    7
    Rep Power
    20

    Default Re: Make 1 Variable demand 2 things ? - (Example ; Variable=1 && 2 )

    A variable can contain one single value only, so if an int variable has the value 1 (one) it isn't 2 (two) or whatever other value; you can change its value but then it lost its previous value ...

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  3. #3
    Zertacus is offline Member
    Join Date
    Jan 2013
    Posts
    3
    Rep Power
    0

    Default Re: Make 1 Variable demand 2 things ? - (Example ; Variable=1 && 2 )

    I figured it out, I was confused by that, I had to create another variable.

Similar Threads

  1. How to compare variable with multiple variable?
    By mharckz009 in forum New To Java
    Replies: 5
    Last Post: 09-11-2012, 04:33 PM
  2. Replies: 1
    Last Post: 04-21-2012, 06:03 PM
  3. Dynamic variable name based on other variable
    By nadissen in forum Eclipse
    Replies: 4
    Last Post: 05-06-2011, 06:22 PM
  4. Replies: 11
    Last Post: 07-07-2010, 06:02 AM
  5. make a variable name from a string?
    By Kinnikinnick in forum New To Java
    Replies: 3
    Last Post: 11-13-2007, 03:54 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •