tobjectlist_first.bmx 500 B

1234567891011121314151617181920212223
  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 first 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.First())
  13. Print value
  14. ' outputs:
  15. ' one