Apparent inconsistent behaviour by the `arrayselectedbuil(` function

When using the arrayselectedbuil( function, it is necessary to enclose the formula parameter in quotes but it seems that this requirement is bypassed if the function is part of an execute statement.

This works fine:

execute {field mgFirstWords formulafill lower(array(} + chevronquoted(mgKD2) + {,1," "))}

A bug or a feature?

Neither. Your example uses the array( function, not arrayselectedbuild(. There is no formula parameter to the array( function.

The arrayselectedbuild( requires that the third parameter be the text of a formula. It doesn’t really have to be in quotes, but it must evaluate to text that is a formula. For example, you could put the text of a formula into a variable, then use that variable. This is 100% consistent in ANY function that requires a formula as a parameter. Dave has explained this several times and I think does a better job of this explanation than I do, so perhaps he’ll chime in.

I copied the wrong statement. It should have been this:

execute {arrayselectedbuild mgTargetArray,mgS1,"",} + chevronquoted(mgKD2) + {+mgS3+} + chevronquoted(mgDat2)

… and the formula does indeed evaluate to text.

… and a high percentage of those explanations have been directed to me.