i have created a menu and i want to create a loop through the menu any time a new entry is made so that it scans to check if the entry is already in the menu, if this is true then i want it to remove the entry from where it is in the menu and place it at the top. can anybody please suggest some possible code for this
Hi there, Chris. Still working on this problem? A number of people made helpful suggestions when you asked the same question a couple of days ago. If you still don't know where to start, perhaps you need to go right back to the beginning. Tell us what classes you think that you need, and then the two fundamental things that you need to know about each class:
What do they need to know, ie fields, and
What do they need to do, ie methods.
Central to this problem is the design of a data structure to hold the menu items. The previous discussion suggested an array or a list. I suggest that you use an array, it will be an easier approach for a beginner.
I also suggest that you do the problem in two parts. Start by ignoring the requirement to avoid duplicate entries, because that is the hardest part. Get everything else working, and by then you should have enough understanding of what you are doing to tackle the removal of duplicate entries as well.