Shoutbox
latest posts
member list
search
rules
contact
login
|
register
|
shoutbox
What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox
»
MsgHelp Archive
»
Messenger Plus! for Live Messenger
»
Scripting
» if somthing is element of an array
if somthing is element of an array
Author:
Message:
JonnyT
Junior Member
Posts: 28
Joined: Jun 2006
O.P.
if somthing is element of an array
is there an easy way to do somthing like:
if Green is an element of the color array do somthing
or basicly searching an array
Thanks Jon
06-29-2006 10:03 PM
can16358p
Junior Member
WLM + MP!L User
Posts: 58
34 /
/ –
Joined: Oct 2005
Status:
Away
RE: if somthing is element of an array
let arrays name be colors, and you are searching for "green"
let exists be the boolean, if there is, it will be true.
var exists=false;
for(var i=0;i<colors.length;i++){
if(colors[i]=="green"){
exists=true;
}
}
06-29-2006 10:10 PM
«
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:
Select Rating...
5 ... Best
4
3 ... Average
2
1 ... Worst
Forum Jump:
Please select one:
--------------------
Latest Posts
Private Messages
User Control Panel
Who's Online
Search
Forum Home
Open Forum
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