void songmaster::org(entry* &newentry)
{
   int result=findsong(newentry->title,newentry->mode); //get index of song array to traverse

   entry* seek=songlist[result].head;
   if(seek!=NULL)                            //if there is at least one entry already
   {
      while(seek->nextuser!=NULL)            //traverse down existing list of entries
         seek=seek->nextuser;
      seek->nextuser=newentry;               //link up the new entry
   }
   else
      songlist[result].head=newentry;           //otherwise link head to entry
}

int songmaster::findsong(const apstring &songname, const apstring &modename)
{
   for(int here=0; here<songlist.length(); here++)
      if(songlist[here].title==songname &&
         songlist[here].mode==modename)
         return here;                        //return location of instance of title in song array

                                             //songname is not found in songlist
   return pushsong(songname,modename);       //so push it on to end of list and return that
}

int songmaster::pushsong(const apstring &songname, const apstring &modename)
{
                                             //couldn't this all be done in a constructor?
   songlist.resize(songlist.length()+1);     //allocate new element in array
   songlist[songlist.length()-1].title=songname;
   songlist[songlist.length()-1].mode=modename;
   songlist[songlist.length()-1].head=NULL;

   return songlist.length()-1;               //return the index of this new element
}
