Yes, we need this!
Why?
Regulary I'm creating event-based code, usually gadget-related. Since I need my own event id's to have it al working I need to keep track of free ID numbers. Usually all my own events start with 1337, then followed by some obscure 0666 number orso. :P
But it would be perfect if there was this RequestID() function that simply keeps track of a list of used EventID's, the BRL ones and even your own ones. So, the only thing you'd have to do when creating an event id is doing:
Global EVENT_COLORCHANGED:int=RequestID()
Global EVENT_COLORCHANGING:int=RequestID()
Global EVENT_BUTTONPRESSED:int=RequestID()
Global EVENT_PALETTECHANGED:int=RequestID()
etc.
Kinda like enum except that you don't need to know which ID's are in use already.
This list of IDs should prolly be an object with a list inside, so this RequestID() function would know where to look for used eventIDs.
A function like this would save me from searching through all my files to check if I don't overwrite some ID (let alone BRL introducing a new ID on a position *I* was already using for my own stuff!). Also, it's portable across users who have their own list!
Why?
Regulary I'm creating event-based code, usually gadget-related. Since I need my own event id's to have it al working I need to keep track of free ID numbers. Usually all my own events start with 1337, then followed by some obscure 0666 number orso. :P
But it would be perfect if there was this RequestID() function that simply keeps track of a list of used EventID's, the BRL ones and even your own ones. So, the only thing you'd have to do when creating an event id is doing:
Global EVENT_COLORCHANGED:int=RequestID()
Global EVENT_COLORCHANGING:int=RequestID()
Global EVENT_BUTTONPRESSED:int=RequestID()
Global EVENT_PALETTECHANGED:int=RequestID()
etc.
Kinda like enum except that you don't need to know which ID's are in use already.
This list of IDs should prolly be an object with a list inside, so this RequestID() function would know where to look for used eventIDs.
A function like this would save me from searching through all my files to check if I don't overwrite some ID (let alone BRL introducing a new ID on a position *I* was already using for my own stuff!). Also, it's portable across users who have their own list!