Example #1
0
        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();
            }
        }
Example #2
0
 public void Goto(LetterLabel label)
 {
     GotoZeroBasedStep(this [label]);
 }
Example #3
0
 public void Gosub(LetterLabel label)
 {
     SaveReturnAddress();
     Goto(label);
 }