Ejemplo n.º 1
0
        public void AddAfter(int index, string wordValue)
        {
            //add given word after given index in the list.
            MemoryLocation newLoc = new MemoryLocation();

            newLoc.Word(wordValue);
            this.AddAfter(index, newLoc);
        }
Ejemplo n.º 2
0
 public void Bind(MemoryLocation memLoc)
 {
     //This is done because the = operator for setting can not be overloaded.
     this.NextLocation     = memLoc.NextLocation;
     this.PreviousLocation = memLoc.PreviousLocation;
     this.ID       = memLoc.ID;
     this.HasError = memLoc.HasError;
     this.Word(memLoc.Word());
 }
Ejemplo n.º 3
0
        public int Add(string wordValue)
        {
            //public wrappper for adding a word value
            MemoryLocation newLoc = new MemoryLocation();
            int            result;

            try
            {
                newLoc.Word(wordValue);

                result = 1;
            }
            catch
            {
                newLoc.Word("0000");
                newLoc.HasError = true;
                result          = -1;
            }
            this.Add(newLoc);
            return(result);
        }
Ejemplo n.º 4
0
 private void addLocationToArrayList(MemoryLocation curLocation, ref ArrayList alLocations)
 {
     //add locations to array list given
     if (curLocation == null)
     {
         //do nothing
     }
     else
     {
         string s = "";
         s += curLocation.Word().WordString;
         alLocations.Add(s);
         addLocationToArrayList(curLocation.NextLocation, ref alLocations);
     }
 }