 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
a_h_k
Joined: 02 Feb 2008 Posts: 626
|
Posted: Sat Feb 27, 2010 6:07 am Post subject: Yet anothr "Functions .. contain functions" thread |
|
|
What's the deal with it? I'm not talking about missing brackets, etc, but whether functions are allowed to contain functions. Sometimes i can call another library function (from within a librarry function), and someties i can't
I've started to create "function_INC" versions, so that certain fns can be #Include'd into certain library fns. But this is far from ideal, as i have over 200 fns to go through and alter
I've heard that if i #Include the used fns into main script, it can get around the problem??
Otherwise, is there any way to preserve my functions library the way it is, without having to use #Includes?
Last edited by a_h_k on Sat Feb 27, 2010 10:26 am; edited 3 times in total |
|
| Back to top |
|
 |
Leef_me
Joined: 08 Apr 2009 Posts: 5336 Location: San Diego, California
|
Posted: Sat Feb 27, 2010 7:09 am Post subject: |
|
|
Your premise "Functions cannot contain functions" is flawed
This code shows they can
| Code: | function(a,b,c,d)
{
return (abs(a)+(mod(b,c)/d))
}
f:=function(-1,17,3,9)
msgbox %f% |
The proper quote is "..a function cannot contain definitions of other functions"
http://www.autohotkey.com/docs/Functions.htm#gosub
You didn't post an example so I have to guess:
If a function hasn't been defined, then the first use may count as 'defining' the function.
Well it looks like I'm wrong on that.
As always, post your code. |
|
| Back to top |
|
 |
TLM
Joined: 21 Aug 2006 Posts: 2926 Location: The Shell
|
Posted: Mon Mar 08, 2010 11:11 pm Post subject: |
|
|
Never had a go at customizing +1 nested calls and was worried when I read this.
| Code: | msgbox % call0()
call0(){
return call1()
}
call1(){
var := "2nd Call"
return var
} |
Alls I can say is fheew .. _________________
paradigm.shift:=(•_•)┌П┐RTFM||^.*∞ |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|