Marc,

I think you might be looking for the old "bubble sort" algorithm. I

would bet you could find many versions of this on the net - but here

is one written in old gwbasic format - which can easily be revised

to LB. Of course, as the previous poster points out LB has its own

sort - but then that takes the "fun" out of it - right? LOL

10 rem Dimension your array to handle the max number of items you

11 rem may have

12 dim a$(100)

14 rem get the values to be sorted - from the user

15 print "Type 999 when finished"

20 input g$

22 if val(g$)=999 then 30

25 n=n+1

26 a$(n)=g$

28 goto 20

30 rem sort the array

32 er=0

35 for t = 2 to n

36 if a$(t-1)<=a$(t) then 50

38 rem flip values

40 h$=a$(t-1)

41 a$(t-1)=a$(t)

42 a$(t)=h$

43 er=1

44 rem er marks the fact that a flip has occurred

45 rem and so you have to do the loop again to ensure

46 rem everything is sorted (or not)

49 rem

50 rem skip flip (not needed)

52 next t

55 if er=1 then goto 32

60 rem everything is now sorted and can be printed (optional)

65 for t = 1 to n

67 print t,a$(t)

70 next t

80 end

* * Glad to help - john

--- In

libertybasic@yahoogroups.com, thefrasers <thefrasers@...>

wrote:

>

> marc.sabau wrote:

> > Hi Friends,

> > Can somebody tell me how to sort out a list of names in

alphabetical

> > order?