What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Combo_GetItemData help [SOLVED]

Combo_GetItemData help [SOLVED]
Author: Message:
pollolibredegrasa
Full Member
***

Avatar
formerly fatfreechicken

Posts: 483
Reputation: 34
35 / Male / Flag
Joined: May 2005
O.P. Combo_GetItemData help [SOLVED]
OK I'm using the code below to add statuses to a combo box, and I'm using the ItemData parameter to store the Status codes.

code:
    OptsWnd.Combo_AddItem("CmbStatus", "Busy", 4);
    OptsWnd.Combo_AddItem("CmbStatus", "Be Right Back",5);   
    OptsWnd.Combo_AddItem("CmbStatus", "Away",7);
    OptsWnd.Combo_AddItem("CmbStatus", "In a Call",8);
    OptsWnd.Combo_AddItem("CmbStatus", "Out To Lunch",9);
   
    for (var i = 0; i <= OptsWnd.Combo_GetCount("CmbStatus"); i++){
         Debug.trace(OptsWnd.Combo_GetItemData("CmbStatus", i));
    }

^^ But when I use GetItemData on the items in that for loop, it ouputs 0 for all of them. I don't know whats wrong, as the combo box IS created in my window, and it IS filled.

Can anyone offer any suggestions?

This post was edited on 10-30-2006 at 06:15 PM by pollolibredegrasa.
;p

[Image: chickennana.gif] Vaccy is my thin twin! [Image: chickennana.gif]
10-30-2006 05:23 PM
Profile PM Find Quote Report
Mnjul
forum super mod
******

Avatar
plz wub me

Posts: 5396
Reputation: 58
– / Other / Flag
Joined: Nov 2002
Status: Away
RE: Combo_GetItemData help
My experience tells me that you need to select the item first to make GetItemData return the correct value.

That is,
code:
for (var i = 0; i <= OptsWnd.Combo_GetCount("CmbStatus"); i++){
     OptsWnd.Combo_SetCurSel("CmbStatus",i);
     Debug.trace(OptsWnd.Combo_GetItemData("CmbStatus", i));
}

10-30-2006 06:13 PM
Profile PM Web Find Quote Report
pollolibredegrasa
Full Member
***

Avatar
formerly fatfreechicken

Posts: 483
Reputation: 34
35 / Male / Flag
Joined: May 2005
O.P. RE: Combo_GetItemData help
Worked, thanks Mnjul :)
;p

[Image: chickennana.gif] Vaccy is my thin twin! [Image: chickennana.gif]
10-30-2006 06:14 PM
Profile PM Find Quote Report
« Next Oldest Return to Top Next Newest »


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On