arraysort.bmx 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. ' Create an array of (nonsense) strings, one for each letter of the alphabet...
  2. Local drivel:String [26]
  3. ' Fill all 26 strings in (remember we include 0, so the last is 25)...
  4. drivel [0] = "Hello"
  5. drivel [1] = "Golly, Miss Lane"
  6. drivel [2] = "I like whippets"
  7. drivel [3] = "Oink"
  8. drivel [4] = "Apparently not"
  9. drivel [5] = "Tell me when, Lord, tell me when"
  10. drivel [6] = "Flat Harry is alive and well"
  11. drivel [7] = "North, Miss Teschmacher, north!"
  12. drivel [8] = "Egg-shaped boy"
  13. drivel [9] = "Say it again"
  14. drivel [10] = "Krazy Kat is a heppy, heppy kitty"
  15. drivel [11] = "Death to the Pixies!"
  16. drivel [12] = "You're wrong"
  17. drivel [13] = "Maybe tomorrow I'll wanna settle down"
  18. drivel [14] = "Jumpin' junipers!"
  19. drivel [15] = "Rock out!"
  20. drivel [16] = "Brilliant!"
  21. drivel [17] = "Victoria was my queen"
  22. drivel [18] = "Leaving so soon?"
  23. drivel [19] = "Quatermass rules"
  24. drivel [20] = "C sucks"
  25. drivel [21] = "Under the stars"
  26. drivel [22] = "Xylophone solo"
  27. drivel [23] = "Zebra hell"
  28. drivel [24] = "Well I never"
  29. drivel [25] = "Perhaps some other time?"
  30. ' Sort the array of strings (type String has a Sort method)...
  31. drivel.Sort
  32. ' Print 'em out in alphabetical order...
  33. For a = 0 Until Len (drivel)
  34. Print a + " : " + drivel [a]
  35. Next