Quellcode durchsuchen

[Brl.LinkedList] Added docs

Ronny Otto vor 6 Jahren
Ursprung
Commit
162b4955ef
42 geänderte Dateien mit 1070 neuen und 19 gelöschten Zeilen
  1. 25 0
      linkedlist.mod/doc/clearlist.bmx
  2. 18 0
      linkedlist.mod/doc/countlist.bmx
  3. 17 19
      linkedlist.mod/doc/createlist.bmx
  4. 22 0
      linkedlist.mod/doc/listaddfirst.bmx
  5. 22 0
      linkedlist.mod/doc/listaddlast.bmx
  6. 24 0
      linkedlist.mod/doc/listcontains.bmx
  7. 27 0
      linkedlist.mod/doc/listfindlink.bmx
  8. 20 0
      linkedlist.mod/doc/listfromarray.bmx
  9. 22 0
      linkedlist.mod/doc/listisempty.bmx
  10. 24 0
      linkedlist.mod/doc/listremove.bmx
  11. 27 0
      linkedlist.mod/doc/listremovelink.bmx
  12. 25 0
      linkedlist.mod/doc/listtoarray.bmx
  13. 25 0
      linkedlist.mod/doc/reverselist.bmx
  14. 54 0
      linkedlist.mod/doc/sortlist.bmx
  15. 33 0
      linkedlist.mod/doc/swaplists.bmx
  16. 22 0
      linkedlist.mod/doc/tlist_addfirst.bmx
  17. 22 0
      linkedlist.mod/doc/tlist_addlast.bmx
  18. 25 0
      linkedlist.mod/doc/tlist_clear.bmx
  19. 24 0
      linkedlist.mod/doc/tlist_contains.bmx
  20. 33 0
      linkedlist.mod/doc/tlist_copy.bmx
  21. 18 0
      linkedlist.mod/doc/tlist_count.bmx
  22. 27 0
      linkedlist.mod/doc/tlist_findlink.bmx
  23. 22 0
      linkedlist.mod/doc/tlist_first.bmx
  24. 27 0
      linkedlist.mod/doc/tlist_firstlink.bmx
  25. 20 0
      linkedlist.mod/doc/tlist_fromarray.bmx
  26. 33 0
      linkedlist.mod/doc/tlist_insertafterlink.bmx
  27. 33 0
      linkedlist.mod/doc/tlist_insertbeforelink.bmx
  28. 23 0
      linkedlist.mod/doc/tlist_isempty.bmx
  29. 22 0
      linkedlist.mod/doc/tlist_last.bmx
  30. 27 0
      linkedlist.mod/doc/tlist_lastlink.bmx
  31. 17 0
      linkedlist.mod/doc/tlist_new.bmx
  32. 24 0
      linkedlist.mod/doc/tlist_remove.bmx
  33. 24 0
      linkedlist.mod/doc/tlist_removefirst.bmx
  34. 24 0
      linkedlist.mod/doc/tlist_removelast.bmx
  35. 27 0
      linkedlist.mod/doc/tlist_removelink.bmx
  36. 25 0
      linkedlist.mod/doc/tlist_reverse.bmx
  37. 33 0
      linkedlist.mod/doc/tlist_reversed.bmx
  38. 54 0
      linkedlist.mod/doc/tlist_sort.bmx
  39. 33 0
      linkedlist.mod/doc/tlist_swap.bmx
  40. 25 0
      linkedlist.mod/doc/tlist_toarray.bmx
  41. BIN
      linkedlist.mod/doc/tlist_toarray.debug
  42. 21 0
      linkedlist.mod/doc/tlist_valueatindex.bmx

+ 25 - 0
linkedlist.mod/doc/clearlist.bmx

@@ -0,0 +1,25 @@
+SuperStrict
+
+Framework Brl.LinkedList
+Import Brl.StandardIO
+
+' create a list to hold some objects
+Local list:TList = CreateList()
+
+' add some string objects to the end of the list
+ListAddLast(list, "one")
+ListAddLast(list, "two")
+ListAddLast(list, "three")
+
+' print amount of elements in the list
+Print CountList(list)
+
+' clear the list and remove all elements
+ClearList(list)
+
+' print amount of elements in the list
+Print CountList(list)
+
+' outputs:
+' 3
+' 0

+ 18 - 0
linkedlist.mod/doc/countlist.bmx

@@ -0,0 +1,18 @@
+SuperStrict
+
+Framework Brl.LinkedList
+Import Brl.StandardIO
+
+' create a list to hold some objects
+Local list:TList = CreateList()
+
+' add some string objects to the end of the list
+ListAddLast(list, "one")
+ListAddLast(list, "two")
+ListAddLast(list, "three")
+
+' print amount of elements in the list
+Print CountList(list)
+
+' outputs:
+' 3

+ 17 - 19
linkedlist.mod/doc/createlist.bmx

@@ -1,19 +1,17 @@
-' createlist.bmx
-
-SuperStrict
-
-' create a list to hold some objects
-
-Local list:TList=CreateList()
-
-' add some string objects to the list
-
-ListAddLast list,"one"
-ListAddLast list,"two"
-ListAddLast list,"three"
-
-' enumerate all the strings in the list
-
-For Local a:String = EachIn list
-	Print a
-Next
+SuperStrict
+
+Framework Brl.LinkedList
+Import Brl.StandardIO
+
+' create a list to hold some objects
+Local list:TList = CreateList()
+
+' add some string objects to the list
+ListAddLast(list,"one")
+ListAddLast(list,"two")
+ListAddLast(list,"three")
+
+' enumerate all the strings in the list
+For Local a:String = EachIn list
+	Print a
+Next

+ 22 - 0
linkedlist.mod/doc/listaddfirst.bmx

@@ -0,0 +1,22 @@
+SuperStrict
+
+Framework Brl.LinkedList
+Import Brl.StandardIO
+
+' create a list to hold some objects
+Local list:TList = CreateList()
+
+' add some string objects to the begin of the list
+ListAddFirst(list, "one")
+ListAddFirst(list, "two")
+ListAddFirst(list, "three")
+
+' enumerate all the strings in the list
+For Local a:String = EachIn list
+	Print a
+Next
+
+' outputs:
+' three
+' two
+' one

+ 22 - 0
linkedlist.mod/doc/listaddlast.bmx

@@ -0,0 +1,22 @@
+SuperStrict
+
+Framework Brl.LinkedList
+Import Brl.StandardIO
+
+' create a list to hold some objects
+Local list:TList = CreateList()
+
+' add some string objects to the end of the list
+ListAddLast(list, "one")
+ListAddLast(list, "two")
+ListAddLast(list, "three")
+
+' enumerate all the strings in the list
+For Local a:String = EachIn list
+	Print a
+Next
+
+' outputs:
+' one
+' two
+' three

+ 24 - 0
linkedlist.mod/doc/listcontains.bmx

@@ -0,0 +1,24 @@
+SuperStrict
+
+Framework Brl.LinkedList
+Import Brl.StandardIO
+
+' create a list to hold some objects
+Local list:TList = CreateList()
+
+' add some string objects to the end of the list
+ListAddLast(list, "one")
+ListAddLast(list, "two")
+ListAddLast(list, "three")
+
+' check if the list contains some elements
+If ListContains(list, "four") Then
+	Print "four"
+EndIf
+
+If ListContains(list, "three") Then
+	Print "three"
+EndIf
+
+' outputs:
+' three

+ 27 - 0
linkedlist.mod/doc/listfindlink.bmx

@@ -0,0 +1,27 @@
+SuperStrict
+
+Framework Brl.LinkedList
+Import Brl.StandardIO
+
+' create a list to hold some objects
+Local list:TList = CreateList()
+
+' add some string objects to the begin of the list
+ListAddLast(list, "one")
+ListAddLast(list, "two")
+ListAddLast(list, "three")
+
+' find the TLink instance of the element/object "two" 
+Local link:TLink = ListFindLink(list, "two")
+
+' remove the element from the list by utilizing the link
+ListRemoveLink(list, link)
+
+' enumerate all the strings in the list
+For Local a:String = EachIn list
+	Print a
+Next
+
+' outputs:
+' one
+' three

+ 20 - 0
linkedlist.mod/doc/listfromarray.bmx

@@ -0,0 +1,20 @@
+SuperStrict
+
+Framework Brl.LinkedList
+Import Brl.StandardIO
+
+' create an array holding some objects
+Local objects:Object[] = ["one", "two", "three"]
+
+' create a linked list out of the elements
+Local list:TList = ListFromArray(objects) 
+
+' enumerate all the strings in the list
+For Local a:String = EachIn list
+	Print a
+Next
+
+' outputs:
+' one
+' two
+' three

+ 22 - 0
linkedlist.mod/doc/listisempty.bmx

@@ -0,0 +1,22 @@
+SuperStrict
+
+Framework Brl.LinkedList
+Import Brl.StandardIO
+
+' create a list to hold some objects
+Local list:TList = CreateList()
+
+' add some string objects to the end of the list
+ListAddLast(list, "one")
+ListAddLast(list, "two")
+ListAddLast(list, "three")
+
+' check if the list contains some elements
+If ListIsEmpty(list) Then
+	Print "list is empty"
+Else
+	Print "list contains elements"
+EndIf
+
+' outputs:
+' list contains elements

+ 24 - 0
linkedlist.mod/doc/listremove.bmx

@@ -0,0 +1,24 @@
+SuperStrict
+
+Framework Brl.LinkedList
+Import Brl.StandardIO
+
+' create a list to hold some objects
+Local list:TList = CreateList()
+
+' add some string objects to the begin of the list
+ListAddLast(list, "one")
+ListAddLast(list, "two")
+ListAddLast(list, "three")
+
+' remove the string "two"
+ListRemove(list, "two")
+
+' enumerate all the strings in the list
+For Local a:String = EachIn list
+	Print a
+Next
+
+' outputs:
+' one
+' three

+ 27 - 0
linkedlist.mod/doc/listremovelink.bmx

@@ -0,0 +1,27 @@
+SuperStrict
+
+Framework Brl.LinkedList
+Import Brl.StandardIO
+
+' create a list to hold some objects
+Local list:TList = CreateList()
+
+' add some string objects to the begin of the list
+ListAddLast(list, "one")
+ListAddLast(list, "two")
+ListAddLast(list, "three")
+
+' find the TLink instance of the element/object "two" 
+Local link:TLink = ListFindLink(list, "two")
+
+' remove the element from the list by utilizing the link
+ListRemoveLink(list, link)
+
+' enumerate all the strings in the list
+For Local a:String = EachIn list
+	Print a
+Next
+
+' outputs:
+' one
+' three

+ 25 - 0
linkedlist.mod/doc/listtoarray.bmx

@@ -0,0 +1,25 @@
+SuperStrict
+
+Framework Brl.LinkedList
+Import Brl.StandardIO
+
+' create a list to hold some objects
+Local list:TList = CreateList()
+
+' add some string objects to the end of the list
+ListAddLast(list, "one")
+ListAddLast(list, "two")
+ListAddLast(list, "three")
+
+' create an array out of the list elements
+Local objects:Object[] = ListToArray(list) 
+
+' enumerate all the strings in the array
+For Local a:String = EachIn objects
+	Print a
+Next
+
+' outputs:
+' one
+' two
+' three

+ 25 - 0
linkedlist.mod/doc/reverselist.bmx

@@ -0,0 +1,25 @@
+SuperStrict
+
+Framework Brl.LinkedList
+Import Brl.StandardIO
+
+' create a list to hold some objects
+Local list:TList = CreateList()
+
+' add some string objects to the end of the list
+ListAddLast(list, "one")
+ListAddLast(list, "two")
+ListAddLast(list, "three")
+
+' reverse the list
+ReverseList(list)
+
+' enumerate all the strings in the list
+For Local a:String = EachIn list
+	Print a
+Next
+
+' outputs:
+' three
+' two
+' one

+ 54 - 0
linkedlist.mod/doc/sortlist.bmx

@@ -0,0 +1,54 @@
+SuperStrict
+
+Framework Brl.LinkedList
+Import Brl.StandardIO
+
+' create a list to hold some objects
+Local list:TList = CreateList()
+
+' add some string objects to the end of the list
+ListAddLast(list, "short")
+ListAddLast(list, "longer")
+ListAddLast(list, "the longest")
+
+
+' DEFAULT SORT
+' sort them (in this case this leads to an alphabetic sort)
+' second parameter sets sort to ascending or not
+SortList(list, True)
+
+' enumerate all the strings in the list
+For Local a:String = EachIn list
+	Print a
+Next
+
+' outputs:
+' longer
+' short
+' the longest
+
+
+' CUSTOM SORT
+' define a custom compare function
+Function MyCompare:Int( o1:Object, o2:Object )
+	If Len(String(o1)) < Len(String(o2)) Then
+		Return -1 ' o1 before o2
+	ElseIf Len(String(o1)) > Len(String(o2)) Then
+		Return 1 ' o1 after o2
+	Else
+		Return 0 ' equal
+	EndIf
+End Function
+
+' sort them with a custom compare function
+SortList(list, True, MyCompare)
+
+' enumerate all the strings in the list
+For Local a:String = EachIn list
+	Print a
+Next
+
+' outputs:
+' short
+' longer
+' the longest

+ 33 - 0
linkedlist.mod/doc/swaplists.bmx

@@ -0,0 +1,33 @@
+SuperStrict
+
+Framework Brl.LinkedList
+Import Brl.StandardIO
+
+' create a list to hold some objects
+Local list:TList = CreateList()
+
+' add some string objects to the end of the list
+ListAddLast(list, "one")
+ListAddLast(list, "two")
+ListAddLast(list, "three")
+
+
+' create a second list
+Local list2:TList = CreateList()
+ListAddLast(list2, "four")
+ListAddLast(list2, "five")
+ListAddLast(list2, "six")
+
+
+' swap the lists
+SwapLists(list, list2)
+
+' enumerate all the strings in the first list
+For Local a:String = EachIn list
+	Print a
+Next
+
+' outputs:
+' four
+' five
+' six

+ 22 - 0
linkedlist.mod/doc/tlist_addfirst.bmx

@@ -0,0 +1,22 @@
+SuperStrict
+
+Framework Brl.LinkedList
+Import Brl.StandardIO
+
+' create a list to hold some objects
+Local list:TList = New TList
+
+' add some string objects to the begin of the list
+list.AddFirst("one")
+list.AddFirst("two")
+list.AddFirst("three")
+
+' enumerate all the strings in the list
+For Local a:String = EachIn list
+	Print a
+Next
+
+' outputs:
+' three
+' two
+' one

+ 22 - 0
linkedlist.mod/doc/tlist_addlast.bmx

@@ -0,0 +1,22 @@
+SuperStrict
+
+Framework Brl.LinkedList
+Import Brl.StandardIO
+
+' create a list to hold some objects
+Local list:TList = New TList
+
+' add some string objects to the end of the list
+list.AddLast("one")
+list.AddLast("two")
+list.AddLast("three")
+
+' enumerate all the strings in the list
+For Local a:String = EachIn list
+	Print a
+Next
+
+' outputs:
+' one
+' two
+' three

+ 25 - 0
linkedlist.mod/doc/tlist_clear.bmx

@@ -0,0 +1,25 @@
+SuperStrict
+
+Framework Brl.LinkedList
+Import Brl.StandardIO
+
+' create a list to hold some objects
+Local list:TList = New TList
+
+' add some string objects to the end of the list
+list.AddLast("one")
+list.AddLast("two")
+list.AddLast("three")
+
+' print amount of elements in the list
+Print list.Count()
+
+' clear the list and remove all elements
+list.Clear()
+
+' print amount of elements in the list
+Print list.Count()
+
+' outputs:
+' 3
+' 0

+ 24 - 0
linkedlist.mod/doc/tlist_contains.bmx

@@ -0,0 +1,24 @@
+SuperStrict
+
+Framework Brl.LinkedList
+Import Brl.StandardIO
+
+' create a list to hold some objects
+Local list:TList = New TList
+
+' add some string objects to the end of the list
+list.AddLast("one")
+list.AddLast("two")
+list.AddLast("three")
+
+' check if the list contains some elements
+If list.Contains("four") Then
+	Print "four"
+EndIf
+
+If list.Contains("three") Then
+	Print "three"
+EndIf
+
+' outputs:
+' three

+ 33 - 0
linkedlist.mod/doc/tlist_copy.bmx

@@ -0,0 +1,33 @@
+SuperStrict
+
+Framework Brl.LinkedList
+Import Brl.StandardIO
+
+' create a list to hold some objects
+Local list:TList = New TList
+
+' add some string objects to the end of the list
+list.AddLast("one")
+list.AddLast("two")
+list.AddLast("three")
+
+' copy the list elements into another one
+Local list2:TList = list.Copy()
+
+' enumerate all the strings in the first list
+For Local a:String = EachIn list
+	Print a
+Next
+
+' enumerate all the strings in the second list
+For Local a:String = EachIn list2
+	Print a
+Next
+
+' outputs:
+' one
+' two
+' three
+' one
+' two
+' three

+ 18 - 0
linkedlist.mod/doc/tlist_count.bmx

@@ -0,0 +1,18 @@
+SuperStrict
+
+Framework Brl.LinkedList
+Import Brl.StandardIO
+
+' create a list to hold some objects
+Local list:TList = New TList
+
+' add some string objects to the end of the list
+list.AddLast("one")
+list.AddLast("two")
+list.AddLast("three")
+
+' print amount of elements in the list
+Print list.Count()
+
+' outputs:
+' 3

+ 27 - 0
linkedlist.mod/doc/tlist_findlink.bmx

@@ -0,0 +1,27 @@
+SuperStrict
+
+Framework Brl.LinkedList
+Import Brl.StandardIO
+
+' create a list to hold some objects
+Local list:TList = New TList
+
+' add some string objects to the end of the list
+list.AddLast("one")
+list.AddLast("two")
+list.AddLast("three")
+
+' find the TLink instance of the element/object "two" 
+Local link:TLink = list.FindLink("two")
+
+' remove the element from the list by utilizing the link
+list.RemoveLink(link)
+
+' enumerate all the strings in the list
+For Local a:String = EachIn list
+	Print a
+Next
+
+' outputs:
+' one
+' three

+ 22 - 0
linkedlist.mod/doc/tlist_first.bmx

@@ -0,0 +1,22 @@
+SuperStrict
+
+Framework Brl.LinkedList
+Import Brl.StandardIO
+
+' create a list to hold some objects
+Local list:TList = New TList
+
+' add some string objects to the end of the list
+list.AddLast("one")
+list.AddLast("two")
+list.AddLast("three")
+
+
+' request the first element in the list and cast it (back) to a string
+' cast is needed as the function returns "object" rather than "string"
+Local value:String = String(list.First())
+
+Print value
+
+' outputs:
+' one

+ 27 - 0
linkedlist.mod/doc/tlist_firstlink.bmx

@@ -0,0 +1,27 @@
+SuperStrict
+
+Framework Brl.LinkedList
+Import Brl.StandardIO
+
+' create a list to hold some objects
+Local list:TList = New TList
+
+' add some string objects to the end of the list
+list.AddLast("one")
+list.AddLast("two")
+list.AddLast("three")
+
+' find first link 
+Local link:TLink = list.FirstLink()
+
+' remove the element from the list by utilizing the link
+list.RemoveLink(link)
+
+' enumerate all the strings in the list
+For Local a:String = EachIn list
+	Print a
+Next
+
+' outputs:
+' two
+' three

+ 20 - 0
linkedlist.mod/doc/tlist_fromarray.bmx

@@ -0,0 +1,20 @@
+SuperStrict
+
+Framework Brl.LinkedList
+Import Brl.StandardIO
+
+' create an array holding some objects
+Local objects:Object[] = ["one", "two", "three"]
+
+' create a linked list out of the elements
+Local list:TList = TList.FromArray(objects) 
+
+' enumerate all the strings in the list
+For Local a:String = EachIn list
+	Print a
+Next
+
+' outputs:
+' one
+' two
+' three

+ 33 - 0
linkedlist.mod/doc/tlist_insertafterlink.bmx

@@ -0,0 +1,33 @@
+SuperStrict
+
+Framework Brl.LinkedList
+Import Brl.StandardIO
+
+' create a list to hold some objects
+Local list:TList = New TList
+
+' add some string objects to the end of the list
+list.AddLast("one")
+list.AddLast("two")
+list.AddLast("three")
+
+' find the link we want to insert something before or after, here for "two"
+Local link:TLink = list.FindLink("two")
+
+'insert a new element before the link
+list.InsertBeforeLink("before two", link)
+
+'insert a new element after the link
+list.InsertAfterLink("after two", link)
+
+' enumerate all the strings in the list
+For Local a:String = EachIn list
+	Print a
+Next
+
+' outputs:
+' one
+' before two
+' two
+' after two
+' three

+ 33 - 0
linkedlist.mod/doc/tlist_insertbeforelink.bmx

@@ -0,0 +1,33 @@
+SuperStrict
+
+Framework Brl.LinkedList
+Import Brl.StandardIO
+
+' create a list to hold some objects
+Local list:TList = New TList
+
+' add some string objects to the end of the list
+list.AddLast("one")
+list.AddLast("two")
+list.AddLast("three")
+
+' find the link we want to insert something before or after, here for "two"
+Local link:TLink = list.FindLink("two")
+
+'insert a new element before the link
+list.InsertBeforeLink("before two", link)
+
+'insert a new element after the link
+list.InsertAfterLink("after two", link)
+
+' enumerate all the strings in the list
+For Local a:String = EachIn list
+	Print a
+Next
+
+' outputs:
+' one
+' before two
+' two
+' after two
+' three

+ 23 - 0
linkedlist.mod/doc/tlist_isempty.bmx

@@ -0,0 +1,23 @@
+SuperStrict
+
+Framework Brl.LinkedList
+Import Brl.StandardIO
+
+' create a list to hold some objects
+Local list:TList = New TList
+
+' add some string objects to the end of the list
+list.AddLast("one")
+list.AddLast("two")
+list.AddLast("three")
+
+' check if the list contains some elements
+If list.IsEmpty() Then
+	Print "list is empty"
+Else
+	Print "list contains elements"
+EndIf
+
+
+' outputs:
+' list contains elements

+ 22 - 0
linkedlist.mod/doc/tlist_last.bmx

@@ -0,0 +1,22 @@
+SuperStrict
+
+Framework Brl.LinkedList
+Import Brl.StandardIO
+
+' create a list to hold some objects
+Local list:TList = New TList
+
+' add some string objects to the end of the list
+list.AddLast("one")
+list.AddLast("two")
+list.AddLast("three")
+
+
+' request the last element in the list and cast it (back) to a string
+' cast is needed as the function returns "object" rather than "string"
+Local value:String = String(list.Last())
+
+Print value
+
+' outputs:
+' three

+ 27 - 0
linkedlist.mod/doc/tlist_lastlink.bmx

@@ -0,0 +1,27 @@
+SuperStrict
+
+Framework Brl.LinkedList
+Import Brl.StandardIO
+
+' create a list to hold some objects
+Local list:TList = New TList
+
+' add some string objects to the end of the list
+list.AddLast("one")
+list.AddLast("two")
+list.AddLast("three")
+
+' find last link 
+Local link:TLink = list.LastLink()
+
+' remove the element from the list by utilizing the link
+list.RemoveLink(link)
+
+' enumerate all the strings in the list
+For Local a:String = EachIn list
+	Print a
+Next
+
+' outputs:
+' one
+' two

+ 17 - 0
linkedlist.mod/doc/tlist_new.bmx

@@ -0,0 +1,17 @@
+SuperStrict
+
+Framework Brl.LinkedList
+Import Brl.StandardIO
+
+' create a list to hold some objects
+Local list:TList = New TList
+
+' add some string objects to the list
+list.Addlast("one")
+list.Addlast("two")
+list.Addlast("three")
+
+' enumerate all the strings in the list
+For Local a:String = EachIn list
+	Print a
+Next

+ 24 - 0
linkedlist.mod/doc/tlist_remove.bmx

@@ -0,0 +1,24 @@
+SuperStrict
+
+Framework Brl.LinkedList
+Import Brl.StandardIO
+
+' create a list to hold some objects
+Local list:TList = New TList
+
+' add some string objects to the begin of the list
+list.AddLast("one")
+list.AddLast("two")
+list.AddLast("three")
+
+' remove the string "two"
+list.Remove("two")
+
+' enumerate all the strings in the list
+For Local a:String = EachIn list
+	Print a
+Next
+
+' outputs:
+' one
+' three

+ 24 - 0
linkedlist.mod/doc/tlist_removefirst.bmx

@@ -0,0 +1,24 @@
+SuperStrict
+
+Framework Brl.LinkedList
+Import Brl.StandardIO
+
+' create a list to hold some objects
+Local list:TList = New TList
+
+' add some string objects to the begin of the list
+list.AddLast("one")
+list.AddLast("two")
+list.AddLast("three")
+
+' remove the first element of the list
+list.RemoveFirst()
+
+' enumerate all the strings in the list
+For Local a:String = EachIn list
+	Print a
+Next
+
+' outputs:
+' two
+' three

+ 24 - 0
linkedlist.mod/doc/tlist_removelast.bmx

@@ -0,0 +1,24 @@
+SuperStrict
+
+Framework Brl.LinkedList
+Import Brl.StandardIO
+
+' create a list to hold some objects
+Local list:TList = New TList
+
+' add some string objects to the begin of the list
+list.AddLast("one")
+list.AddLast("two")
+list.AddLast("three")
+
+' remove the last element of the list
+list.RemoveLast()
+
+' enumerate all the strings in the list
+For Local a:String = EachIn list
+	Print a
+Next
+
+' outputs:
+' one
+' two

+ 27 - 0
linkedlist.mod/doc/tlist_removelink.bmx

@@ -0,0 +1,27 @@
+SuperStrict
+
+Framework Brl.LinkedList
+Import Brl.StandardIO
+
+' create a list to hold some objects
+Local list:TList = New TList
+
+' add some string objects to the end of the list
+list.AddLast("one")
+list.AddLast("two")
+list.AddLast("three")
+
+' find the link of the element/object "two" 
+Local link:TLink = list.FindLink("two")
+
+' remove the element from the list by utilizing the link
+list.RemoveLink(link)
+
+' enumerate all the strings in the list
+For Local a:String = EachIn list
+	Print a
+Next
+
+' outputs:
+' one
+' three

+ 25 - 0
linkedlist.mod/doc/tlist_reverse.bmx

@@ -0,0 +1,25 @@
+SuperStrict
+
+Framework Brl.LinkedList
+Import Brl.StandardIO
+
+' create a list to hold some objects
+Local list:TList = New TList
+
+' add some string objects to the end of the list
+list.AddLast("one")
+list.AddLast("two")
+list.AddLast("three")
+
+' reverse the list
+list.Reverse()
+
+' enumerate all the strings in the list
+For Local a:String = EachIn list
+	Print a
+Next
+
+' outputs:
+' three
+' two
+' one

+ 33 - 0
linkedlist.mod/doc/tlist_reversed.bmx

@@ -0,0 +1,33 @@
+SuperStrict
+
+Framework Brl.LinkedList
+Import Brl.StandardIO
+
+' create a list to hold some objects
+Local list:TList = New TList
+
+' add some string objects to the end of the list
+list.AddLast("one")
+list.AddLast("two")
+list.AddLast("three")
+
+' create another list containing the elements in reversed order
+Local list2:TList = list.Reversed()
+
+' enumerate all the strings in the first list
+For Local a:String = EachIn list
+	Print a
+Next
+
+' enumerate all the strings in the second list
+For Local a:String = EachIn list2
+	Print a
+Next
+
+' outputs:
+' one
+' two
+' three
+' three
+' two
+' one

+ 54 - 0
linkedlist.mod/doc/tlist_sort.bmx

@@ -0,0 +1,54 @@
+SuperStrict
+
+Framework Brl.LinkedList
+Import Brl.StandardIO
+
+' create a list to hold some objects
+Local list:TList = New TList
+
+' add some string objects to the end of the list
+list.AddLast("short")
+list.AddLast("longer")
+list.AddLast("the longest")
+
+
+' DEFAULT SORT
+' sort them (in this case this leads to an alphabetic sort)
+' second parameter sets sort to ascending or not
+list.Sort(True)
+
+' enumerate all the strings in the list
+For Local a:String = EachIn list
+	Print a
+Next
+
+' outputs:
+' longer
+' short
+' the longest
+
+
+' CUSTOM SORT
+' define a custom compare function
+Function MyCompare:Int( o1:Object, o2:Object )
+	If Len(String(o1)) < Len(String(o2)) Then
+		Return -1 ' o1 before o2
+	ElseIf Len(String(o1)) > Len(String(o2)) Then
+		Return 1 ' o1 after o2
+	Else
+		Return 0 ' equal
+	EndIf
+End Function
+
+' sort them with a custom compare function
+list.Sort(True, MyCompare)
+
+' enumerate all the strings in the list
+For Local a:String = EachIn list
+	Print a
+Next
+
+' outputs:
+' short
+' longer
+' the longest

+ 33 - 0
linkedlist.mod/doc/tlist_swap.bmx

@@ -0,0 +1,33 @@
+SuperStrict
+
+Framework Brl.LinkedList
+Import Brl.StandardIO
+
+' create a list to hold some objects
+Local list:TList = New TList
+
+' add some string objects to the end of the list
+list.AddLast("one")
+list.AddLast("two")
+list.AddLast("three")
+
+
+' create a second list
+Local list2:TList = New TList
+list2.AddLast("four")
+list2.AddLast("five")
+list2.AddLast("six")
+
+
+' swap the lists
+list.Swap(list2)
+
+' enumerate all the strings in the first list
+For Local a:String = EachIn list
+	Print a
+Next
+
+' outputs:
+' four
+' five
+' six

+ 25 - 0
linkedlist.mod/doc/tlist_toarray.bmx

@@ -0,0 +1,25 @@
+SuperStrict
+
+Framework Brl.LinkedList
+Import Brl.StandardIO
+
+' create a list to hold some objects
+Local list:TList = New TList
+
+' add some string objects to the end of the list
+list.AddLast("one")
+list.AddLast("two")
+list.AddLast("three")
+
+' create an array out of the list elements
+Local objects:Object[] = list.ToArray() 
+
+' enumerate all the strings in the array
+For Local a:String = EachIn objects
+	Print a
+Next
+
+' outputs:
+' one
+' two
+' three

BIN
linkedlist.mod/doc/tlist_toarray.debug


+ 21 - 0
linkedlist.mod/doc/tlist_valueatindex.bmx

@@ -0,0 +1,21 @@
+SuperStrict
+
+Framework Brl.LinkedList
+Import Brl.StandardIO
+
+' create a list to hold some objects
+Local list:TList = New TList
+
+' add some string objects to the end of the list
+list.AddLast("one")
+list.AddLast("two")
+list.AddLast("three")
+
+' find the element at the given index and cast it (back) to a string
+' cast is needed as the function returns "object" rather than "string"
+Local value:String = String(list.ValueAtIndex(1))
+
+Print value 
+
+' outputs:
+' two