 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
scouchman
Joined: 28 Apr 2004 Posts: 45
|
Posted: Mon May 15, 2006 3:36 am Post subject: Using A_IsCompiled to set #NoTrayIcon |
|
|
I can't figure out what I'm doing wrong here. Seems like it should be so simple, maybe just too tired.
I build in a few troubleshooting options in my scripts before I compile them, and wanted to be able to leave them in there as I'm working on them. Right now I'm remarking them out, but occasionally forget, so wanted to make a programmer proof option.
The most basic one is the tray icon. In ahk form, I want it for testing/reloading, etc., but in compiled form I do not want the icon there. So thought this would work:
| Code: | | IfNotEqual, A_IsCompiled, , #NoTrayIcon |
or
| Code: | | IfEqual, A_IsCompiled, 1, #NoTrayIcon |
or
| Code: | IfEqual, A_IsCompiled, 1
{
#NoTrayIcon
} |
or
| Code: | IfNotEqual, A_IsCompiled,
{
#NoTrayIcon
} |
The single line options, the icon is present in both compiled and non compiled moded.
The multiline options, the icon is missing in both compiled and non compiled moded. (I've tried with and withouth the {}).
Is this a bug? Am I doing something incorrect? Did I miss reading about this somewhere? _________________ Scott F Couchman |
|
| Back to top |
|
 |
SKAN
Joined: 26 Dec 2005 Posts: 6264
|
Posted: Mon May 15, 2006 5:57 am Post subject: |
|
|
Dear Scott F Couchman,
| Code: | IfEqual, A_IsCompiled, 1
{
#NoTrayIcon
} |
| You wrote: | | Is this a bug? Am I doing something incorrect? Did I miss reading about this somewhere? |
No! This is not a bug. You cannot put a conditional Hash Directive!
Means,
Directives like
#Persistent
#NoTrayIcon
etc
cannot be controlled with an IF condition.
Whenever AHK sees a Directive, it just effects it and does not consider the lines before are after.
AHK is designed to function that way.
The following example is a workaround:
| Code: | #Persistent
#NoTrayIcon
If (!A_IsCompiled)
Menu,Tray,Icon
Return
^#X::ExitApp
^#C::Run, Calc.exe |
Regards,  _________________
 |
|
| 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
|