I have a function:
BuildMenu (ByRef pBase AS MenuItem, pMenu() AS Variant) AS Boolean
I call it with a mixture of strings and booleans, as in:
Result = BuildMenu (base, Array ("Run", False, "Edit", "Rename", "Delete") )
‘False’ means the previous menu item is disabled (‘True’ means it is enabled, but is optional and assumed)
Because the boolean elements are optional, it is possible to make a call using only string elements, such as:
Result = BuildMenu (base, Array ("Run", "Edit", "Rename", "Delete") )
But when I do this, I get the following compile error:
When I try:
BuildMenu (base, Variant (Array ("Run", "Edit", "Rename", "Delete") ) )
I get the following error:
I can fix it by adding a redundant boolean argument in the function call, as in:
Result = BuildMenu (base, Array ("Run", "Edit", "Rename", "Delete", True) )
I don’t know how to call the BuildMenu function with only string array elements without causing a type mismatch error. Any thoughts?
Thanks in advance,
Alex