TravisT commented on a Page, INPUT  -  Jan 07, 2009

LEss code is better yes. I was just showing other ways of doing it. Also, look into using elseif in these situations.

If you say:

if ($1 == .m) { command }
if ($1 == .q) { command }
if ($1 == .k) { command }
etc.

Even if it matches .m, which means it won't match any of the others, it will still go through each if statement till it gets to the closing bracket.

if ($1 == .m) { command }
elseif ($1 == .q) { command }
elseif ($1 == .k) { command }

Now this will only check until it gets a match and then it will stop.

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.