-----=====notthecheatr linked list object=====-----

=====Introduction=====
What is a linked list?  Very simply, it lets you store a list of items in order (kind of like an array)
but not necessarily sequentially in memory.  It does this via pointers, where each item in the list
contains a pointer to its data and a pointer to the next item.  Thus, each item can be stored anywhere
in memory.  For example, in a GUI system you might have a bunch of windows.  Each window would be in a linked
list, and inserting a new window in between two others wouldn't take a long time, since you just have to change
some pointers - while if you use an array or a regular list, you'd have to move all the windows over in memory
to put the new one in between the others.

A simple Google search will give you more information about how this works or how it is done;  you can also
look at my source code.  It's well commented and should be pretty easy to figure out.  Anyways, this is a linked
list object, meaning the interface is very clean and user-friendly and the internals of how it actually works
are hidden from you, so for example you don't even know where the items are stored in memory, you access them
with an index just like a regular array.  It's also thread-safe, in case you use multithreading in your programs,
and it should be just about as efficient as possible (though I don't claim to be perfect by any means).

=====Usage=====
To use, you must first include the linkedList .BAS file in your program:
  #Include Once "linkedList.bas"
The only reason it's not a proper module (linkedList.bi and liblinkedList.a) is that we want to be able to
specify what type of data is stored in the linked list.  The first non-comment lines of the linked list objects
.BAS file look like this:
  #define LIST_DATA_TYPE uInteger
  #define DEFAULT_LIST_DATA 0
This means the list stores uIntegers and if you request a list item that doesn't exist it will return 0.
You can set this to any other type except Strings and it should work just fine.  Most likely if you use this
a lot you'll set it to Any Ptr (which is the same size as uInteger) - you can point it at any data type, including
objects, if you do that.  This is how you would, for example, store a list of window objects.

Once that's taken care of, you simply need to Dim a linkedList object in your program:
  Dim As linkedList myList
Or you can create a list with a pointer:
  Dim As linkedList Ptr myList = New(linkedList)
(just remember to use -> instead of . to access methods if it's a pointer)

It will automatically initialize itself and do everything it needs to be a valid linked list object.  It starts
out with no items in it;  you add items as you need to.  You can add an item to the very end of the list, using
addItem:
  myList.addItem(3)
Or you can insert an item in a specific location before another item.  The first item in the list is always 0;
to insert an item between the second and third item you would put 2, which is the index of the third item:
  myList.insertItem(3, 2)
If you wish to find out what the value of an item in the list is, you can use getItem with the index of the item
you need:
  Print Str(myList.getItem(2))
you can remove an item from the list using removeItem:
  myList.removeItem(2)
this will remove a single item while leaving all other items before and after it intact and in their places.
You can also remove all the items in the list:
  myList.removeAll()
You can swap two items if you know their indexes:
  myList.swapItems(0, 2)
Finally, you can find out how many items are in a list with the property numItems:
  Print Str(myList.numItems)

These are all the basic things you can do with a list.  Once you're done with the list, if it's a pointer created
with New use Delete.  Otherwise, just removeAll and leave it until the end of the program when it will be
destroyed.  Either way, when the object is destroyed it will clean up all the memory it takes up by removing
all the items it contains.  For obvious reasons, you should not attempt to use a linkedList object after it
has been destroyed;  in fact, all methods check to ensure the object is still valid and, if not, will not do
anything.

=====Example=====
An example is provided, in test.bas.  It assumes the list items are uInteger, and it demonstrates all the major
operations you would perform on a list.  Read through it, perhaps run it, to see how it all works.