tobjectlist_contains.bmx 448 B

123456789101112131415161718192021222324
  1. SuperStrict
  2. Framework Brl.ObjectList
  3. Import Brl.StandardIO
  4. ' create an object list to hold some objects
  5. Local list:TObjectList = New TObjectList
  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