listremove.bmx 448 B

123456789101112131415161718192021222324
  1. SuperStrict
  2. Framework Brl.LinkedList
  3. Import Brl.StandardIO
  4. ' create a list to hold some objects
  5. Local list:TList = CreateList()
  6. ' add some string objects to the begin of the list
  7. ListAddLast(list, "one")
  8. ListAddLast(list, "two")
  9. ListAddLast(list, "three")
  10. ' remove the string "two"
  11. ListRemove(list, "two")
  12. ' enumerate all the strings in the list
  13. For Local a:String = EachIn list
  14. Print a
  15. Next
  16. ' outputs:
  17. ' one
  18. ' three