bLisTeRinG
Joined: 15 Nov 2004 Posts: 45 Location: Warrnambool
|
Posted: Sun Jan 09, 2005 10:39 am Post subject: Does Menu "x" exist? |
|
|
I'm putzing around with a File/Folder menu which is absolutly [b]Brilliant[/b].
[i]Except [/i]I've got all these same-name folders, and they end up in each others sub-menus.
If only I could find out whether or not they exist.
Like some imaginary ...
"[b]Loop, Menu, %MyMenuName%[/b]"
...command.
Anyone worked this out? |
|
Chris Site Admin
Joined: 02 Mar 2004 Posts: 10467
|
Posted: Sun Jan 09, 2005 3:24 pm Post subject: |
|
|
Although I don't understand the exact nature of the problem, you can detect whether a menu exists by trying a harmless command on it while UseErrorLevel is in effect. For example: | Code: | Menu, Tray, UseErrorLevel ; This affects all menus, not just the tray.
Menu, MyMenu, NoDefault
if ErrorLevel <> 0
MsgBox That menu does not exist. |
Similarly, to detect whether a menu item exists, try a harmless command on it: | Code: | Menu, MyMenu, Uncheck, MyMenuItem
if ErrorLevel <> 0
MsgBox That menu item does not exist. |
|
|