Consts to Enum / Enum to Consts
- John
- Oct 15
- 1 min read
VBE_Extras will now convert declaration(s) between Consts and an Enum.
If the cursor / selection is one or multiple Consts, VBE_Extras converts those Consts to an Enum (one Enum member for each Const).
If the cursor is within an Enum (or the entire selection is an Enum), VBE_Extras converts that Enum to Consts (one Const for each Enum member).
This "Consts to Enum / Enum to Consts" command was primarily added to help when adding Windows API declarations … many constant values come in large groups of individual Consts when a single Enum would be more helpful. This command fulfils that need.
Note that the idea of this command is that the Consts will be converted to an Enum (or vice-versa) immediately after adding them (i.e. before you add other code that references them). Hence, this command does not update references of the Consts (or the Enum) when converting them. If you have already added other code that references them then you may need to manually update that code following the conversion.



Comments