Build variables Crazy Style! int and strings

I have a real tricky thing i am trying to do here and maybe one of you smarty pants can help me out.
here is the simple scoop:
//-------------------------------
string $BASE = "basket";
string $SUB = "A";
int $basketA[] = {101,102,250};
int $NUM = 0;

string $PIE = ("int $"+$BASE+$SUB+"[$NUM]");
eval ($PIE);
//-------------------------------

I want to build the variable name that I will want to query.
As you can see this mel script builds the variable so that I can eventualy get a loop that returns $PIE being equal to 101, 102 and 250. Yesh? No?
WHaddaTHink?

Mel can't do this, but php can =)

something like this?

string $BASE = "basket";
string $SUB = "A";
int $basketA[] = {101,102,250};
int $NUM = 0;

string $PIE = ("$"+$BASE+$SUB+"["+$NUM+"]");
eval ("int $returned = "+$PIE);
print $returned;

putting the latter few lines in a loop, incrementing $NUM, works fine

not sure if this is what you're after

sweet! You rock. I knew i had some syntax all jacked up.
THANKS again!