Quote:
>Hi!
>I made a bubbleSort like this:
>Do
> Ready = True
> For J = 0 To List1.ListCount - 1
With J=0, the first iteration attempts to compare List1.List(-1) to
List1.List(0). This loop should start with J=1 since List1.List(-1) is
undefined.
Quote:
> If List1.List(J - 1) > List1.List(J) Then
> Temp = List1.List(J - 1)
> List1.List(J - 1) = List1.List(J)
> List1.List(J) = Temp
> Valmis = False
I believe the above s/b 'Ready = False'.
Quote:
> End If
> Next J
>Loop Until Ready = True
>How can I replace the listbox vwith a Variable?
> something like:
>Dim XXX(20)
> For J = 0 To List1.ListCount - 1
> If XXX(J - 1) > XXX(J) Then
> Temp = XXX(J - 1)
> XXX(J - 1) = XXX(J)
> XXX = Temp
> Valmis = False
> End If
> Next J
>This does not work.
>Thak you!
Since there are two known reasons why this doesn't work, I'm not surprised
it didn't, but why do you want to replace listbox with a variable? To save
yourself some typing? It wouldn't save much. You might want to look into
the 'cutting' and 'pasting' or 'copying' functions available in the editor.
-CB