What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Elseif?

Elseif?
Author: Message:
Pizzaboy861
New Member
*


Posts: 1
Joined: May 2007
O.P. Elseif?
Hey I'm new to scripting with Messenger Plus! and was wondering if it had an elseif thingy. IE:

if(color == 'red')
    <do this>
elseif(color == 'blue')
   <do this>
elseif(color == 'green')
   <dothis>


does Messenger Plus! have anything like this?

Thanks!
05-09-2007 04:48 PM
Profile E-Mail PM Find Quote Report
Felu
Veteran Member
*****


Posts: 2223
Reputation: 72
29 / Male / Flag
Joined: Apr 2006
Status: Away
RE: Elseif?
use 'else if' MP!L scripting uses JScript syntax.
05-09-2007 04:52 PM
Profile E-Mail PM Web Find Quote Report
Adeptus
Senior Member
****


Posts: 732
Reputation: 40
Joined: Oct 2005
RE: Elseif?
JScript (like most other languages borrowing from C) has the switch statement, which seems appropriate for what you want to do, especially if you are testing for more than three cases.  Documentation can be found here.
05-09-2007 06:37 PM
Profile E-Mail PM Find Quote Report
Dennis Mike
Junior Member
**

Avatar

Posts: 59
Reputation: 2
33 / Male / –
Joined: Jan 2007
RE: Elseif?
f(color == 'red'){
Debug.Trace("red")
}
elseif(color == 'blue')
{
Debug.Trace("blue")
}
elseif(color == 'green')
{
Debug.Trace("green")
}
05-09-2007 09:30 PM
Profile PM Web Find Quote Report
deAd
Scripting Contest Winner
*****

Avatar

Posts: 1060
Reputation: 28
– / Male / Flag
Joined: Jan 2006
RE: RE: Elseif?
quote:
Originally posted by Dennis Mike
f(color == 'red'){
Debug.Trace("red")
}
elseif(color == 'blue')
{
Debug.Trace("blue")
}
elseif(color == 'green')
{
Debug.Trace("green")
}

that won't work... A switch statement would be good for this, but if you want to use an if statement it would be something like this (this is shortened):
code:
if(color == "red"){
// color is red
} else if(color == "blue"){
// color is blue
}
05-09-2007 10:12 PM
Profile PM Find Quote Report
« Next Oldest Return to Top Next Newest »


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On