Shoutbox

[HELP] Variable assignment error - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Messenger Plus! for Live Messenger (/forumdisplay.php?fid=4)
+---- Forum: Scripting (/forumdisplay.php?fid=39)
+----- Thread: [HELP] Variable assignment error (/showthread.php?tid=83800)

[HELP] Variable assignment error by SmokingCookie on 05-18-2008 at 07:53 PM

Hi,

I'm constantly anoyed by an error as I try to assign a varable:

code:
function OnWndOptEvent_CtrlClicked(PlusWnd,ControlId) {
    if(ControlId == "BtnOK") {
        Key = "HKEY_CURRENT_USER" + BackSlash + "Software" + BackSlash + "Microsoft" + BackSlash + "MSNMessenger" + BackSlash + "PerPassportSettings" + BackSlash + Messenger.MyUserId + BackSlash + " DefaultSignInState", {
        Value = WndOpt.Combo_GetCurSel("CmbStatus"); // line 129
        Type = "REG_DWORD";
        RegWrite(Key,Value,Type);
    }
}


The debugger shows "error in line 129: ':' is expected".

In another script I use exactly the same method and it works.
Does Messenger have a bad day today?

Thanks in advance..
RE: [HELP] Variable assignment error by roflmao456 on 05-18-2008 at 08:30 PM

code:
var Key, Value, Type;
function OnWndOptEvent_CtrlClicked(PlusWnd,ControlId) {
if(ControlId == "BtnOK") {
Key = "HKEY_CURRENT_USER\\Software\\Microsoft\\MSNMessenger\\PerPassportSettings\\" + Messenger.MyUserId + "\\DefaultSignInState";
Value = PlusWnd.Combo_GetCurSel("CmbStatus");
Type = "REG_DWORD";
RegWrite(Key,Value,Type);
}
}
should work now.
i don't think you could use strings as functions 8-)

either WndOpt (variable) isn't defined or on line 128:
code:
[...]"DefaultSignInState", {

RE: [HELP] Variable assignment error by CookieRevised on 05-18-2008 at 09:15 PM

btw, instead of BackSlash, why don't you use "\\", it would make long lines like Key ="..." much more readable. ;)

This might have helped in seeing that that line of code had a syntax error which in the end resulted in the error message.


RE: [HELP] Variable assignment error by SmokingCookie on 05-19-2008 at 04:47 PM

Because "\\" makes it confusing. I use Plus!'s script editor. Its colorization llows me to "detect" strngs that haven't been ended (like "hello; which misses a quote mark) and other stuff.

Example (note Key2):

[Image: screenieyy7.th.jpg]

And btw: it seems to work now, so thanks (again :$ :P )