What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Whats wrong with this (debuging will not open as well) :(...

Whats wrong with this (debuging will not open as well) :(...
Author: Message:
plus
Banned


Posts: 127
Reputation: -10
Joined: Jan 2007
O.P. Wink  Whats wrong with this (debuging will not open as well) :(...
Say this was a script nothing else what would be wrong with it.

code:
function OnEvent_ChatWndSendMessage(oChatWnd, sMessage){
    if (sMessage === 'hello'){
        MsgPlus.DisplayToast('hello', 'Capital letters remember and full stops');
    }
    else if (sMessage === 'hiya'){
        MsgPlus.DisplayToast('hiya', 'Capital letters remember and full stops');
    }

The debuging dosnt open some how?

This post was edited on 01-13-2007 at 09:15 PM by plus.
01-13-2007 09:15 PM
Profile E-Mail PM Find Quote Report
J-Thread
Full Member
***

Avatar

Posts: 467
Reputation: 8
– / Male / –
Joined: Jul 2004
RE: Whats wrong with this (debuging will not open as well) :(...
The only thing I see is that you're missing a closing bracket ( } ) of the function...

This post was edited on 01-13-2007 at 09:27 PM by J-Thread.
01-13-2007 09:26 PM
Profile E-Mail PM Find Quote Report
plus
Banned


Posts: 127
Reputation: -10
Joined: Jan 2007
O.P. RE: Whats wrong with this (debuging will not open as well) :(...
Were?
01-13-2007 09:33 PM
Profile E-Mail PM Find Quote Report
Eljay
Elite Member
*****

Avatar
:O

Posts: 2949
Reputation: 77
– / Male / –
Joined: May 2004
RE: Whats wrong with this (debuging will not open as well) :(...
quote:
Originally posted by L. Coyote
Not only are you missing a closing bracket for the function, but you are also using === instead of ==.

=== doesn't mean anything, it's not correct.

umm dont post when you dont know what youre talking about :P

=== is a perfectly valid operator, it does the same thing as the == operator with the addition of checking the type of the two variables being compared (which in this case is not really needed, but wont make any difference).

The only thing wrong with that code is the missing closing bracket.
01-13-2007 09:56 PM
Profile PM Find Quote Report
J-Thread
Full Member
***

Avatar

Posts: 467
Reputation: 8
– / Male / –
Joined: Jul 2004
RE: RE: Whats wrong with this (debuging will not open as well) :(...
quote:
Originally posted by .2007
Were?

Sorry, but I'm not going to answer that one.

I advice you to search these forums / the internet for a programming course to learn some very basics. If you  have problems with it, you can always ask (polite) and me or (more probable) one of the other forum members will help you. But promise me that you will read the answers carefully, because the answer is in my previous post.
01-13-2007 10:45 PM
Profile E-Mail PM Find Quote Report
plus
Banned


Posts: 127
Reputation: -10
Joined: Jan 2007
O.P. RE: Whats wrong with this (debuging will not open as well) :(...
ok i am asking,

Can you please tell me were the missing } is.

Thank you very mutch.
01-13-2007 11:47 PM
Profile E-Mail PM Find Quote Report
NanaFreak
Scripting Contest Winner
*****


Posts: 1476
Reputation: 53
32 / Male / Flag
Joined: Jul 2006
RE: Whats wrong with this (debuging will not open as well) :(...
code:
function OnEvent_ChatWndSendMessage(oChatWnd, sMessage){
    if (sMessage === 'hello'){
        MsgPlus.DisplayToast('hello', 'Capital letters remember and full stops');
    }
    else if (sMessage === 'hiya'){
        MsgPlus.DisplayToast('hiya', 'Capital letters remember and full stops');
    }
}

;)
01-13-2007 11:51 PM
Profile PM Find Quote Report
plus
Banned


Posts: 127
Reputation: -10
Joined: Jan 2007
O.P. RE: Whats wrong with this (debuging will not open as well) :(...
Thanks NanaFreak :)
01-13-2007 11:56 PM
Profile E-Mail PM Find Quote Report
CookieRevised
Elite Member
*****

Avatar

Posts: 15519
Reputation: 173
– / Male / Flag
Joined: Jul 2003
Status: Away
RE: RE: Whats wrong with this (debuging will not open as well) :(...
quote:
Originally posted by .2007
Were?
quote:
Originally posted by J-Thread
The only thing I see is that you're missing a closing bracket ( } ) of the function...
read underlined part carefully ;)

In most programming languages you always must enclose a group of statements with some sort of character or other start/ending statement.

In JScript, when you start a group of statements with "{" you always must close the group with "}".

To avoid such mistakes it is almost mandatory to properly indent each line of code so you can easly see where you're missing some starting/closing character.

quote:
Originally posted by Eljay
=== is a perfectly valid operator, it does the same thing as the == operator with the addition of checking the type of the two variables being compared. (which in this case is not really needed, but wont make any difference)
yes and no... It is the other way around...

When you use === no additional type conversions are done. It is with the use of == that extra stuff is done. Hence I would personally always use === wherever possible. And I see == as a special case of ===, not the other way around.

But you're right that in this case it wont make a difference in the outcome of the function since both are strings already.

So it is == which wouldn't be realy needed.

Ref: CookieRevised's reply to Nudges, Updated.

;)

This post was edited on 01-14-2007 at 06:37 AM by CookieRevised.
.-= A 'frrrrrrrituurrr' for Wacky =-.
01-14-2007 02:56 AM
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