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

Code Help
Author: Message:
Spunky
Former Super Mod
*****

Avatar

Posts: 3658
Reputation: 61
36 / Male / Flag
Joined: Aug 2006
RE: Code Help
quote:
Originally posted by Felu
If you assign a value to a variable inside a function but don't declare it, it becomes a global variable.

Exactly, but you already declared the variable outside a function, making it global. I thought all variables should be declared and you couldn't just go:
JScript code:
function one(){
    myVar = 100;
}
 
function two(){
    myVar += 100;
}
 
Debug.Trace(myVar);

<Eljay> "Problems encountered: shit blew up" :zippy:
12-08-2008 11:28 AM
Profile PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
Code Help - by MicroWay on 12-07-2008 at 05:50 AM
RE: Code Help - by Felu on 12-07-2008 at 06:50 AM
RE: Code Help - by Spunky on 12-08-2008 at 07:41 AM
RE: Code Help - by Felu on 12-08-2008 at 09:52 AM
RE: Code Help - by Spunky on 12-08-2008 at 11:28 AM
RE: Code Help - by MicroWay on 12-10-2008 at 10:01 PM


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