tobjectlist_addfirst.bmx 406 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 begin of the list
  7. list.AddFirst("one")
  8. list.AddFirst("two")
  9. list.AddFirst("three")
  10. ' enumerate all the strings in the list
  11. For Local a:String = EachIn list
  12. Print a
  13. Next
  14. ' outputs:
  15. ' three
  16. ' two
  17. ' one