tobjectlist_last.bmx 498 B

12345678910111213141516171819202122
  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. ' request the last element in the list and cast it (back) to a string
  11. ' cast is needed as the function returns "object" rather than "string"
  12. Local value:String = String(list.Last())
  13. Print value
  14. ' outputs:
  15. ' three