AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Call Functions - documentation

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
Guest






PostPosted: Tue May 13, 2008 5:01 pm    Post subject: Call Functions - documentation Reply with quote

I donīt understand what this mean in the dokumentation
"Although a function cannot contain definitions of other functions"

Does it mean that I canīt Call another function/functions from one function?
If You Can - How many level?


Ex:
I have problem to Call another functions from one function.
(If a program (DOS) was running, I want to close the program before a new session (DOS) is started.)


This work for me - a function call outside the function
EndProgram(progname)
StartProgram(15)
ExitApp

StartProgram(Sec)
{
....
Start a new session of the program
....
}


EndProg(WindowName)
{
.....
}



This doesnīt work for me - a function call inside the function
StartProgram(15)
ExitApp

StartProgram(Sec)
{
EndProgram(progname)
....
Start a new session of the program
....
}


EndProg(WindowName)
{
.....
}[/b]
Back to top
TheIrishThug



Joined: 19 Mar 2006
Posts: 361

PostPosted: Tue May 13, 2008 6:52 pm    Post subject: Reply with quote

The documentation means that you can not define a function inside another function, like this.
Code:
func1()
{
  msgbox, inside 1
  func2()
  {
     msgbox, inside 2
  }
}

Calling one function from withing another function works fine. You should check to see what the exact differences are between your two implementations.
Back to top
View user's profile Send private message Visit poster's website AIM Address
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group