Enum and lists

Hi! Quick question about enum.
I need a function to receive some values from an enum type like:

enum MyEnum
{
  a,
  b,
  c
}

function GetEnumList (lst: MyEnum[])
{
  var e: MyEnum;
  for (x in lst)
  {
    e = x;
  }
}

and to choose “a” and “c” for instance:

  GetEnumList ([a, c]);

But is a pain to build the fixed array on real case use. How to make it work with ArrayList or generic lists? Like:

function GetEnumList (lst: ArrayList)
{
  var e: MyEnum;
  for (x in lst)
  {
    e = x;
  }
}

This result in error as x is an object and not compatible with enum values. Any idea?

Tnx!

import System.Collections.Generic;

function GetEnumList (lst: List.<MyEnum>)
...

–Eric

Worked! Thank you.