tlist_contains.bmx 428 B

123456789101112131415161718192021222324
  1. SuperStrict
  2. Framework Brl.LinkedList
  3. Import Brl.StandardIO
  4. ' create a list to hold some objects
  5. Local list:TList = New TList
  6. ' add some string objects to the end of the list
  7. list.AddLast("one")
  8. list.AddLast("two")
  9. list.AddLast("three")
  10. ' check if the list contains some elements
  11. If list.Contains("four") Then
  12. Print "four"
  13. EndIf
  14. If list.Contains("three") Then
  15. Print "three"
  16. EndIf
  17. ' outputs:
  18. ' three