I just finished a script that I needed and didn't find in mel funtions. So here take it and use it well guys.
/*
Created by Ricky Hoffman
Date of Creation: May 5th,2004
Inputs:
-String array of your list that you want shorten
-A sorted array of Int(s) of the location of removal
Return:
-String array of your list after removal
*/
//-------------------------Remove Item(s) from a String-------------------
proc string[] removeItemString(string $list[],int $num[])
{
string $tempList[];
int $tempNum[];
int $count=0;
$tempList=$list;
clear($list);
for($i=0;$i{
if($i!=$num[0])
{
$list[$count]=$tempList[$i];
$count++;
}
}
$tempNum=$num;
clear($num);
for($i=1;$i{
$num[($i-1)]=($tempNum[$i])-1;
}
if(size($num)
!=0)
$list=removeItemString($list,$num);
return ($list);
}
//----------------------------Testing Area--------------------------------
int $test[];
string $testLine[];
$test[0]=0;
$test[1]=2;
$test[2]=1;
int $afterSorting[] = sort($test);
$testLine[0]="Work";
$testLine[1]="Eat";
$testLine[2]="Sleep";
$testLine[3]="Programming";
print "Before Removal:n";
print $testLine;
removeItemString($testLine,$afterSorting);
print "nnAfter Removal:n";
print $testLine;
//-------------------------------Results----------------------------------
Before Removal:
Work
Eat
Sleep
Programming
After Removal:
Programming