Raised This Month: $ Target: $400
 0% 

if(... and ...) ???


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Bone
Member
Join Date: Mar 2005
Location: Under your bed
Old 04-18-2005 , 20:24   if(... and ...) ???
Reply With Quote #1

I want to know how you do something like

Code:
if (bob = 1 and jim = 2)

I dont think you put and in between them thou do you?
__________________
the shirt covered her face, she screamed and clawed, so billy stomped on the bitch until he broke in her jaw.
Bone is offline
Send a message via MSN to Bone
Twilight Suzuka
bad
Join Date: Jul 2004
Location: CS lab
Old 04-18-2005 , 20:27  
Reply With Quote #2

&&
__________________
Twilight Suzuka is offline
Send a message via AIM to Twilight Suzuka Send a message via MSN to Twilight Suzuka
BioHazardousWaste
Senior Member
Join Date: Apr 2005
Location: Ontario, Canada =)
Old 04-18-2005 , 20:36  
Reply With Quote #3

i think you need a double equals sign dont' you? or is that just java and c++?

if (bob == 1 && jim ==2)
{
stuff
}
else
{
more stuff
}
__________________
"What then is truth? Truths are illusions which we have forgotten are illusions - they are metaphors that have become worn out... this (truth) is the duty to lie according to a fixed convention.

-Friedrich Nietzsche
BioHazardousWaste is offline
Send a message via MSN to BioHazardousWaste
Bone
Member
Join Date: Mar 2005
Location: Under your bed
Old 04-18-2005 , 20:41  
Reply With Quote #4

thanks, i always ut == i dont know if its needed thou
__________________
the shirt covered her face, she screamed and clawed, so billy stomped on the bitch until he broke in her jaw.
Bone is offline
Send a message via MSN to Bone
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 04-19-2005 , 11:40  
Reply With Quote #5

This is the way I look at it.

--
Code:
if(bob == jim) { ... }
If bob IS EQUAL TO jim.
--
Code:
if(bob != jim) { ... }
If bob is NOT EQUAL TO jim.
--
Code:
if(bob != jim || jim != joe) { ... }
If bob is NOT EQUAL TO jim OR jim is NOT EQUAL TO joe.
--
Code:
if(bob == jim && jim != joe) { ... }
If bob is EQUAL TO jim AND jim is NOT EQUAL TO joe.
--
Code:
if(bob <= jim) { ... }
If bob is LESS THAN OR EQUAL TO jim
--
Code:
if(bob >= jim) { ... }
If bob is GREATER THAN OR EQUAL TO jim
--

Hope that helps..
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x is offline
Bone
Member
Join Date: Mar 2005
Location: Under your bed
Old 04-19-2005 , 15:24  
Reply With Quote #6

yeah quite a bit actually :-D thanks
__________________
the shirt covered her face, she screamed and clawed, so billy stomped on the bitch until he broke in her jaw.
Bone is offline
Send a message via MSN to Bone
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 04-19-2005 , 18:51  
Reply With Quote #7

Oh, and for this:
Code:
if(bob == 1) { ... } if(bob == 0) { ... }
You could just do:
Code:
if(bob) { ... } if(!bob) { ... }


Btw, I edited my above post a wee bit..
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 09:51.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode