Please take a look at the example I provided and read How to use UDFs .

Please notye that I just corrected a spelling error in my example code, the function call is ArrayEnumValue and I wrote ArrayEnumKey, which will not work. I have corrected my example code acordingly.
_________________________
There are two types of vessels, submarines and targets.