Hey i'm doing a sort using the strComp function... but i'm not getting what i need. I'm sorting from a higher value to a lower one. i'm taking values (integers) out of a database and putting them into a string(array). This is an example of what i'm getting...
69
65
64
109
108
107
this is my code
Do
intsflag = 0
For intx = 1 To UBound(strEntry, 2) - 1
r = StrComp(Val(strEntry(3, intx)), Val(strEntry(3, (intx + 1))), 0)
If r = -1 Then
For inti = 1 To 4
strsort(inti, 1) = strEntry(inti, (intx + 1))
strsort(inti, 2) = strEntry(inti, intx)
Next inti
For inti = 1 To 4
strEntry(inti, intx) = strsort(inti, 1)
strEntry(inti, (intx + 1)) = strsort(inti, 2)
Next inti
intsflag = 1
End If
Next intx
Loop While intsflag = 1
do i need another way of comparing?? any help would be great, thanks
NUQE
We all know about the "stupid user" don't we...
69
65
64
109
108
107
this is my code
Do
intsflag = 0
For intx = 1 To UBound(strEntry, 2) - 1
r = StrComp(Val(strEntry(3, intx)), Val(strEntry(3, (intx + 1))), 0)
If r = -1 Then
For inti = 1 To 4
strsort(inti, 1) = strEntry(inti, (intx + 1))
strsort(inti, 2) = strEntry(inti, intx)
Next inti
For inti = 1 To 4
strEntry(inti, intx) = strsort(inti, 1)
strEntry(inti, (intx + 1)) = strsort(inti, 2)
Next inti
intsflag = 1
End If
Next intx
Loop While intsflag = 1
do i need another way of comparing?? any help would be great, thanks
NUQE
We all know about the "stupid user" don't we...