AutoHotkey Community

It is currently May 26th, 2012, 4:15 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 7 posts ] 
Author Message
PostPosted: October 4th, 2008, 6:30 pm 
I was editing my .ahk file which contains lots of stuff..
It worked without a flaw until I changed something that wasn't
in any connection with the following what so ever.

But all of a sudden it started complaining that EnableLeave()
function cannot contain functions..

I didn't change anything in the following code, or anything
that uses these functions.

Why did it start to give me errors all of a sudden?


Code:
DisableLeave()
   {
   WinGet, Manage, List, [ID=, , ,
   Control, Disable, , Button9, ahk_id %Manage1%
   Control, Disable, , Button9, ahk_id %Manage2%
   }

EnableLeave()
   {
   WinGet, Manage, List, [ID=, , ,
   Control, Enable, , Button9, ahk_id %Manage1%
   Control, Enable, , Button9, ahk_id %Manage2%
   }


[Title edited. Please write descriptive titles for your topics. ~jaco0646]


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: October 4th, 2008, 6:36 pm 
Fixed :roll:


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: April 14th, 2009, 7:03 pm 
Offline

Joined: December 30th, 2006, 4:13 pm
Posts: 132
Location: Margaritaville (a state of mind somewhere between Inebriation and San Diego), CA
I'm having the same problem and can't find any problems in my code. How did you fix this? What should I look for? I can't even debug this because it goes straight to that error message. Won't show MsgBoxes or ListVars or anything. :x


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 14th, 2009, 7:42 pm 
Offline

Joined: December 30th, 2006, 4:13 pm
Posts: 132
Location: Margaritaville (a state of mind somewhere between Inebriation and San Diego), CA
I commented out the ENTIRE function. Still get the exact same error.

Had the bright idea to undo a bunch of times then try again. Cool. Got back to where it was working (albeit without the new code). Now to redo, save, test, repeat until I find the problem line. BUT MY DAMN EDITOR WIPED MY REDO HISTORY!

So unhappy right now. I've been over and over and over my code. No idea how I'm going to find the problem now. :cry:


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 14th, 2009, 7:49 pm 
Offline

Joined: May 27th, 2007, 9:41 am
Posts: 4999
The Function that gives the error is correct it is part of the script ABOVE the function that generates the error:
Code:
FunkyError()
   {
   MsgBox This generates an error at FuncA
   ;} ; because of missing } here

FuncA()
 {
   MsgBox A
 }
   
FuncB()
 {
   MsgBox B
 }   

_________________
AHK FAQ
TF : Text files & strings lib, TF Forum


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 14th, 2009, 8:07 pm 
Offline

Joined: December 30th, 2006, 4:13 pm
Posts: 132
Location: Margaritaville (a state of mind somewhere between Inebriation and San Diego), CA
HugoV wrote:
The Function that gives the error is correct
I have a hard time with that since removing the entire function still generates the same error, but that point is moot.
Quote:
it is part of the script ABOVE the function that generates the error
Yeah, I cut a large section of my code (representing almost all of my recent code changes) and the problem went away. So I started pasting it back in, a chunk at a time. I found the (fairly small) block of code that's causing the problem...
Code:
If (add > 0)
} <------ OOPS!  :oops:
   GUI, 1:Destroy
   GUI, 2:Destroy
   GUI, 3:Destroy
   add = 0
   edit = 1
}
Thanks for the help, Hugo!


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 14th, 2009, 8:20 pm 
Offline

Joined: December 30th, 2006, 4:13 pm
Posts: 132
Location: Margaritaville (a state of mind somewhere between Inebriation and San Diego), CA
I'd be willing to bet that a close curly bracket where there should have been an open curly bracket was what caused exousia's problem, too.


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: BrandonHotkey, Cerberus, poserpro, Yahoo [Bot] and 17 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group