Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Really Easy Question
Index -> Programming, Java -> Java Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Aclimator




PostPosted: Tue Feb 08, 2011 2:33 pm   Post subject: Really Easy Question

I have some code:

if (gp.getRank() >= guild.getPerm("use chest"))
canBuild = true;

if I change it to this:

if (gp.getRank() >= or <= guild.getPerm("use chest"))
canBuild = true;

Will it still work?

I added "or <=", so pretty much any value, and canBuild will equal true.

Is that right? If not, can someone just fix it really quick?
Sponsor
Sponsor
Sponsor
sponsor
Tony




PostPosted: Tue Feb 08, 2011 2:37 pm   Post subject: RE:Really Easy Question

what does the expression of
code:

gp.getRank() >=

mean?
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Aclimator




PostPosted: Tue Feb 08, 2011 2:57 pm   Post subject: RE:Really Easy Question

Im pretty new to java, and this is someone elses code.

But what I do know is that the expression is getting a value from a text file. If that value is greater or equal to the value from another txt file, then

canBuild = true.

I just need a way to make canBuild always true.
Aclimator




PostPosted: Tue Feb 08, 2011 3:16 pm   Post subject: RE:Really Easy Question

Any help?
Sur_real




PostPosted: Tue Feb 08, 2011 5:13 pm   Post subject: RE:Really Easy Question

if you want canBuild to be always true, why would you need to have an if statement?
Display posts from previous:   
   Index -> Programming, Java -> Java Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 5 Posts ]
Jump to:   


Style:  
Search: