quote:
Originally posted by djdannyp
Edit: The statuses show in the list box at the moment as numbers (relating to the number item they are in the listbox......however they kinda need to be parsed as 'STATUS_ONLINE', etc.....how can I accomplish this? Also how can I get them to show in the listbox as their item name, rather than number
js code:
var status = new Array("Unknown", "Offline", "", "Online", "Busy", "BRB", "Idle", "Away", "In A Call", "Out to Lunch"); // I think I got them in the right order
Debug.Trace(status[Contact.Status]); // Obviously, you have to enumerate contacts to get the status...
EDIT:
We make an array called "status" and populate it with the values. As an array is 0-based, The first item (at index 0) is "Unknown". If you look in the scripting docs, the number to represent "Unknown" is also 0, which is why we placed it first. 1 Represents "Offline" and so on... 3 is blank as it is not used in this situation.
So when we Trace the status, we pass the Contact.Status similar to a parameter in a function. If the contact status is 6 (Idle), it would be the same as:
js code:
Debug.Trace(status[6]); //Which would trace "Idle"