I want to sort the data by the SuppCodeArry
in a loop. This is my code:
<%
SuppCodeArry="SA^SA^SB^SA^SC^SB^SA^"
ITEMArry="A^B^C^D^E^F^G^"
str_SuppCode = Split(SuppCodeArry,"^")
str_ItemCode = Split(ITEMArry,"^")
SUPPCODE = ""
str_SuppCode_NEW = ""
str_ItemCode_NEW = ""
For a=0 To UBound(str_SuppCode)-1
Response.Write str_SuppCode(a) & " ["&str_ItemCode(a)&"] <br>"
str_SuppCode_NEW = str_SuppCode_NEW & str_SuppCode(a) &"^"
str_ItemCode_NEW = str_ItemCode_NEW & str_ItemCode(a) &"^"
Next
%>
The result I get with this code is:
SA [A]
SA [B]
SB [C]
SA [D]
SC [E]
SB [F]
SA [G]
I would like to have the result by grouping by the SuppCodeArry
as below. How do I do this?
SA [A]
SA [B]
SA [D]
SA [G]
SB [C]
SB [F]
SC [E]
Thanks for any info on this.