Ok, an exerpt from a visual designer (the same situation applies to all scripting applications).. (Please note, this is for all use of #PB_ANY and not just menu items, even though it certainly applies here!)
With enumerations, I would need to set aside so many place holders and hope that this will not over flow or be under used (impossible). So I set asside 100 enumerations just for "dynamic" controls needed for designing.
Code: Select all
Enumeration
#MaybeUse0 ; Will be 0
#MaybeUse1 ; Will be 1
#MaybeUse2 ; Will be 2
.....
#MaybeUse100
EndEnumeration
Now with any wide spread, professional commercial application, 100 gadgets will not be enough (luckily, we have a partial implimentation of #PB_ANY available to fix this problem). Now with the problem above, we must first type out each and every single constant to use. For dynamic reasons, enumerations are worthless, as you must GUESS how many # of enumerations the user (or scripter, or designer, etc) will use, effectively either creating a hard cap on how many they can use, OR wasting memory & hard drive space (application bloat).
The dynamic use of #PB_ANY actually prevents bloat

Back to the issue. Not only do you have to create tons of enumerations, you must also reference these constants individually through out the code. It can be a painfull experience to say the least.
With the use of #PB_ANY... you can use the following
Code: Select all
Structure strDynGadget
DynGadget.l
EndStructure
Newlist DynGadget.strDynGadget()
AddElement(DynGadget())
DynGadget()\DynGadget = ButtonGadget(#PB_ANY, 10, 10, 200, 20, "Standard Button")
Want to look it up? Grab it from the link list. This is 100% dynamic. No bloat, no wasted hard drive space, nor ram. This is all a consideration when creating commercial software. If there was two programs, one coded the old way (enumerations), and one coded the #PB_ANY way, and they both do the same thing, except the old way inheritally uses way more resources. Which one would you choose? Commercially? Regular users usually dont care about these things, but companies do.