private int this [LetterLabel label] { get { ArrayList a = labels [(int)label]; int pos = a.BinarySearch(next); if (pos >= 0) { return((int)a [pos]); // next found in the array. } else if (~pos < a.Count) { return((int)a [~pos]); // next not found in the array, return the next higher. } else if (a.Count == 0) { throw new Error(); // empty array. } else { return((int)a [0]); // wrap around. } } set { ArrayList a = labels [(int)label]; Trace.Assert(!a.Contains(value)); a.Add(value); a.Sort(); } }
public void Goto(LetterLabel label) { GotoZeroBasedStep(this [label]); }
public void Gosub(LetterLabel label) { SaveReturnAddress(); Goto(label); }