泛型类ArrayList 貌似比grasshooper自己发明的List类方便很多,不用每次指定容器的类型。
private void RunScript(int x, ref object A, ref object B)
{
ArrayList myAL = new ArrayList();
for(int i = 0;i < x;i++)
myAL.Add(x);
A = myAL;
List <int> myL = new List<int>();
myL.Add(x);
B = Util.addone(34, 12, 354, 2);
// B = myL;
}
// <Custom additional code>
class Util
{
public static int Min(params int[] paramListr)
{
int currentMin = paramListr[0];
foreach (int i in paramListr)
{
if(i < currentMin)
{
currentMin = i;
}
}
return currentMin;
}
public static ArrayList addone(params int[] paramListr)
{
ArrayList temp = new ArrayList();
//int currentSum = 0;
foreach (int i in paramListr)
{
temp.Add(i);
}
return temp;
}
}
// </Custom additional code>
}
|