count = 0
Do Until RS2.EOF
count = count + 1
For i = 0 to ant_inlagg
If myArray(9,i) = RS2("fldbildid") then
mystring33 = mystring33 & count & ","
mystring44 = mystring44 & myArray(16,i) & ","
End If
Next
RS2.MoveNext
Loop
RS2.MoveFirst
Detta ger mig två stycken strängar, typ:
mystring33 = 5,15,28,
mystring44 = 2,3,1,
Nu är läget som så att jag vill få ut den första strängen sorterad efter den andra, slutresultatet skall med andra ord bli:
mystring33 = 28,5,15,
Hur löser jag det? En snyggare lösning från start är väl iofs inte helt fel.
count = 0
Do Until RS2.EOF
count = count + 1
For i = 0 to ant_inlagg
If myArray(9,i) = RS2("fldbildid") then
sortorder = sortorder & myArray(16,i) & ","
myArray3(myArray(16,i))= count
Arrcount = Arrcount + 1
End If
Next
RS2.MoveNext
Loop
RS2.MoveFirst
DB_close
For i = 1 to Arrcount
sorterad = sorterad & myArray3(i) & ","
Next
l = len(sorterad)
if l > 0 then
sorterad = left(sorterad,l-1)
end if
sorterad = "mystring=""" & sorterad & """"
Response.Write sorterad