What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Call a Function within a Function

Pages: (2): « First [ 1 ] 2 » Last »
Call a Function within a Function
Author: Message:
Black_Ice
Junior Member
**


Posts: 26
33 / Male / –
Joined: Jun 2006
O.P. Call a Function within a Function
I'd just like a little guidence with this one please. How (if you can) can I call a function in a function. The first function being outside the 2nd one. Example:

Function test1() {
...blah blah code.....
}

Function test2() {
call test1()
}

Thanks for any help. Sorry for the easy question.

This post was edited on 08-14-2006 at 10:32 AM by Black_Ice.
08-14-2006 10:30 AM
Profile E-Mail PM Find Quote Report
vikke
Senior Member
****

Avatar

Posts: 900
Reputation: 28
31 / Male / Flag
Joined: May 2006
RE: Call a Function within a Function
code:
function test1() {
...blah blah code.....
}

function test2() {
test1();
}

08-14-2006 10:31 AM
Profile E-Mail PM Find Quote Report
Intosia
Junior Member
**

Avatar
I'm dynamic ^^

Posts: 78
40 / Male / –
Joined: Mar 2004
RE: Call a Function within a Function
http://en.wikipedia.org/wiki/JavaScript
08-14-2006 10:52 AM
Profile E-Mail PM Web Find Quote Report
Black_Ice
Junior Member
**


Posts: 26
33 / Male / –
Joined: Jun 2006
O.P. RE: Call a Function within a Function
Correct me if I'm wrong but isn't JavaScript different to the JScript we use in WLM P!
08-14-2006 10:56 AM
Profile E-Mail PM Find Quote Report
alexp2_ad
Scripting Contest Winner
****

Avatar
Who love the chocolate?

Posts: 691
Reputation: 26
36 / Male / –
Joined: May 2004
Status: Away
RE: RE: Call a Function within a Function
quote:
Originally posted by Black_Ice
Correct me if I'm wrong but isn't JavaScript different to the JScript we use in WLM P!

Same kind of syntax, they are very, very close.
08-14-2006 10:57 AM
Profile E-Mail PM Find Quote Report
Intosia
Junior Member
**

Avatar
I'm dynamic ^^

Posts: 78
40 / Male / –
Joined: Mar 2004
RE: RE: Call a Function within a Function
quote:
Originally posted by Black_Ice
Correct me if I'm wrong but isn't JavaScript different to the JScript we use in WLM P!

Well, its not -the same- but stuff like syntax and functions and stuff is the same, thats why i give you the link :)

This post was edited on 08-14-2006 at 10:58 AM by Intosia.
08-14-2006 10:58 AM
Profile E-Mail PM Web Find Quote Report
Black_Ice
Junior Member
**


Posts: 26
33 / Male / –
Joined: Jun 2006
O.P. RE: Call a Function within a Function
Ok thanks very much. For anyone seeking this answer. It's quite simple:
code:
function test1() {
blah..blah..code
};

function test2() {
test1();
};

08-15-2006 08:25 AM
Profile E-Mail PM Find Quote Report
davidt
New Member
*


Posts: 7
Joined: Aug 2006
RE: Call a Function within a Function
Yes, functions are global and so can be called from anywhere. It's only the variables withinn functions that stay within the function.
08-15-2006 09:13 AM
Profile E-Mail PM Find Quote Report
markee
Veteran Member
*****

Avatar

Posts: 1621
Reputation: 50
35 / Male / Flag
Joined: Jan 2006
RE: Call a Function within a Function
quote:
Originally posted by davidt
Yes, functions are global and so can be called from anywhere. It's only the variables withinn functions that stay within the function.
Though you can carry it over to another function when you call upon that second function, you just have to put it between the brackets.
[Image: markee.png]
08-15-2006 09:16 AM
Profile PM Find Quote Report
davidt
New Member
*


Posts: 7
Joined: Aug 2006
RE: Call a Function within a Function
Yeah :) - I was talking about situations like

var test = 123;
function t() { Debug.Trace(test); }

Does anybody know if Jscript is pass-by-value of pass-by-reference? I think it is the latter.
08-15-2006 09:35 AM
Profile E-Mail PM Find Quote Report
Pages: (2): « First [ 1 ] 2 » Last »
« 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