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 

#directives and if

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Bug Reports
View previous topic :: View next topic  
Author Message
kapege.de



Joined: 07 Feb 2005
Posts: 186
Location: Munich, Germany

PostPosted: Wed Feb 09, 2005 1:17 pm    Post subject: #directives and if Reply with quote

Bug or feature?
The following script does not behave as expected:

myEXE = 0
if myEXE = 1
{
msgbox, %myEXE% ; is NOT executed
#NoTrayIcon ; is EXECUTED!
#SingleInstance force ; is EXECUTED!
FileInstall, default.ini, custom.ini, 0 ; is NOT executed
}


I think It would be better, when the #directives would only be executed if the if-clause is valid. I think that you check for the number signs (#) before running the script.
I for myself always need two versions of a script: One is running in script-mode while developing, another one is running as .exe. When I swap the "myEXE" variable I quickly can change the behaviour of the script before compiling.

Is it planned to change that?
Would be great!

Thanx


Peter
Back to top
View user's profile Send private message Visit poster's website
jonny



Joined: 13 Nov 2004
Posts: 3004
Location: Minnesota

PostPosted: Wed Feb 09, 2005 5:50 pm    Post subject: Reply with quote

It's impossible to conditionally pass directives because they are processed before the script actually starts executing. It might help to think of them as a completely separate part of the script, above conditions, blocks, and labels.

The nature of directives and the need for processing them first means this fact won't change, by the way.
Back to top
View user's profile Send private message
kapege.de



Joined: 07 Feb 2005
Posts: 186
Location: Munich, Germany

PostPosted: Mon Feb 14, 2005 10:02 am    Post subject: Reply with quote

Thanx. I'll comment them out like before.

Peter
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Bug Reports 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