Jump to content

A list with all == , != , && , etc?


Eliwood407
 Share

You are about to reply to a thread that has been inactive for 3895 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

Hello there, I am slowly getting more efficient and better at SLS.

I do have a question about certain "if" and "else" possibilities.
Is there a list that shows all options like the ones I listed below?
I know a few, but I would like to know if there is a "or" possibility.

 

            if(llDetectedName(i) == "Bullet")
//means that if the object is called Bullet it will:...

            if(llDetectedName(i) != "Bullet")
//means that if the object is not called Bullet it will not:...

            if(llDetectedName(i) == "Bullet" && "Cody")
//Despite it not being possible; means that if the object is called Bullet AND Cody it will:...

//---------------What I would like to know:

            if(llDetectedName(i) == "Bullet" OR "Cody")

            if(llDetectedName(i) == "Bullet" AND NOT "Cody")

 

I hopy my question is clear enough.

Link to comment
Share on other sites

Hello there, I am slowly getting more efficient and better at SLS.

I do have a question about certain "if" and "else" possibilities.
Is there a list that shows all options like the ones I listed below?
I know a few, but I would like to know if there is a "or" possibility.

 

            if(llDetectedName(i) == "Bullet")
//means that if the object is called Bullet it will:...

            if(llDetectedName(i) != "Bullet")
//means that if the object is not called Bullet it will not:...

            if(llDetectedName(i) == "Bullet" && "Cody")
//Despite it not being possible; means that if the object is called Bullet AND Cody it will:...

//---------------What I would like to know:

            if(llDetectedName(i) == "Bullet" OR "Cody")

            if(llDetectedName(i) == "Bullet" AND NOT "Cody")

 

I hopy my question is clear enough.

Link to comment
Share on other sites

The OR would be:

if(llDetectedName(i) == "Bullet" || llDetectedName(i) == "Cody")// means that if the object is called Bullet OR Cody it will:...

 The NOT is expressed via "!" as in

 

integer running = TRUE;integer error = FALSE;if( running && !error ) {    // do stuff if running is active and no error occured up to now}

 So the list you look for contains:

comparison operators: == != < <= > >=

logical operators: && || !

bitwise operators: & | ~ ^

Full list with some info for you at http://wiki.secondlife.com/wiki/LSL_Operators

 

Edit: I'm too slow at typing :-/

  • Like 1
Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 3895 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...