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 

Bug with Menu add and dupilcate variable values

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



Joined: 24 Jun 2005
Posts: 12

PostPosted: Tue Apr 01, 2008 12:10 am    Post subject: Bug with Menu add and dupilcate variable values Reply with quote

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
View user's profile Send private message
jballi



Joined: 01 Oct 2005
Posts: 297
Location: Texas, USA

PostPosted: Tue Apr 01, 2008 1:20 am    Post subject: Reply with quote

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
View user's profile Send private message
Spike



Joined: 24 Jun 2005
Posts: 12

PostPosted: Tue Apr 01, 2008 11:06 pm    Post subject: Reply with quote

Thanks jballi,somehow I missed that
Back to top
View user's profile Send private message
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