// Collection of code snippets by Arne Vajhøj // (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) using System; using System.Collections; public class ThreeInOne { private ArrayList list1; private ArrayList list2; private ArrayList list3; public ThreeInOne() { list1 = new ArrayList(); list2 = new ArrayList(); list3 = new ArrayList(); } public void Add(object o1, object o2, object o3) { list1.Add(o1); list2.Add(o2); list3.Add(o3); } public object GetFirst(int ix) { return list1[ix]; } public object GetSecond(int ix) { return list2[ix]; } public object GetThird(int ix) { return list3[ix]; } public int Count { get { return list1.Count; } } } class TestClass { public static void Main(string[] args) { ThreeInOne superlist = new ThreeInOne(); superlist.Add("a", 1, 1.2); superlist.Add("bb", 12, 12.34); for(int i = 0; i < superlist.Count; i++) { Console.WriteLine(superlist.GetFirst(i) + " " + superlist.GetSecond(i) + " " + superlist.GetThird(i)); } } }