Re: [Gambas-user] WHILE and AND: please explain me....

2010-05-07 Thread Fabien Bodard
and a tips : FOR i = 1 TO (matrix.Count - 1) you can do : FOR i = 1 TO matrix.Max 2010/5/7 Fabián Flores Vadell : > 2010/5/4, Leonardo Miliani : >> I'm working with this little piece of code, it's the Insertion Sort: >> >> PUBLIC SUB InsertionSort(matrix AS String[]) >> DIM i, j AS Integer >>

Re: [Gambas-user] WHILE and AND: please explain me....

2010-05-06 Thread Fabián Flores Vadell
2010/5/4, Leonardo Miliani : > I'm working with this little piece of code, it's the Insertion Sort: > > PUBLIC SUB InsertionSort(matrix AS String[]) > DIM i, j AS Integer > DIM x AS String > > FOR i = 1 TO (matrix.Count - 1) > x = matrix[i] > j = i - 1 > WHILE j >= 0 AND matrix[j] > x

Re: [Gambas-user] WHILE and AND: please explain me....

2010-05-04 Thread Benoît Minisini
> I'm working with this little piece of code, it's the Insertion Sort: > > PUBLIC SUB InsertionSort(matrix AS String[]) > DIM i, j AS Integer > DIM x AS String > > FOR i = 1 TO (matrix.Count - 1) > x = matrix[i] > j = i - 1 > WHILE j >= 0 AND matrix[j] > x > matrix[j + 1] = ma

[Gambas-user] WHILE and AND: please explain me....

2010-05-04 Thread Leonardo Miliani
I'm working with this little piece of code, it's the Insertion Sort: PUBLIC SUB InsertionSort(matrix AS String[]) DIM i, j AS Integer DIM x AS String FOR i = 1 TO (matrix.Count - 1) x = matrix[i] j = i - 1 WHILE j >= 0 AND matrix[j] > x matrix[j + 1] = matrix[j] j -= 1