 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
Spike
Joined: 24 Jun 2005 Posts: 12
|
Posted: Tue Apr 01, 2008 12:10 am Post subject: Bug with Menu add and dupilcate variable values |
|
|
Hi,
Please run these 2 short scripts separately
It will build a menu list from the vars variable & should be like this:
a
b
c
d
e
which is correct
the second menu will show
a
b
c
d
e
WHERE is the 2nd a which should be at the end
Is it me or a bug??
cheers
Jan
| Code: |
;gives correct answer
vars=a,b,c,d,e
loop,parse,vars,`,
{
findclip:=A_LoopField
menu,buildmenu ,add, %findclip%,menuhandler
}
menu,buildmenu, Show
return
menuhandler:
MsgBox You selected "%A_ThisMenuItem%"
;ExitApp
|
| Code: |
;gives wrong answer
vars=a,b,c,d,e,a
;NOTE 2nd a ^ IT WONT SHOW UP IN BUIDMENU
loop,parse,vars,`,
{
findclip:=A_LoopField
menu,buildmenu ,add, %findclip%,menuhandler1
}
menu,buildmenu, Show
return
menuhandler1:
MsgBox You selected "%A_ThisMenuItem%"
|
|
|
| Back to top |
|
 |
jballi
Joined: 01 Oct 2005 Posts: 297 Location: Texas, USA
|
Posted: Tue Apr 01, 2008 1:20 am Post subject: |
|
|
From the documentation...
| Quote: | Add [, MenuItemName, Label-or-Submenu, Pn]: This is a multipurpose command that adds a menu item, updates one with a new submenu or label, or converts one from a normal item into a submenu (or vice versa). If MenuItemName does not yet exist, it will be added to the menu. Otherwise, MenuItemName is updated with the newly specified Label-or-Submenu.
|
I hope this helps. |
|
| Back to top |
|
 |
Spike
Joined: 24 Jun 2005 Posts: 12
|
Posted: Tue Apr 01, 2008 11:06 pm Post subject: |
|
|
| Thanks jballi,somehow I missed that |
|
| 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
|