kero

Thu 2 Mar 2006 11:24:16
Thu 2 Mar 2006 11:24:16
คือมี array อยู่ แบบนี้ (a,b,c,b,d,a,e)
ต้องการให้ได้ array ใหม่ เป็น (a,b,c,d,e) คือให้สมาชิกไม่ซ้ำ
ทำยังไงค่ะ วนลูปมึนแล้วอ่ะ
asp ค่ะ
ผมเขียน VB ไม่เก่งนะครับ แต่ลองเอาไปเป็นไกด์แล้วกันครับ
Dim arr
a = Array(a,b,c,b,d,a,e)
Dim ret
Foreach item in a
Dim chk = False
For i = Lbound(a) To Ubound(a)
If a(i) = item Then
chk = True
End If
If Not chk Then
a(Ubound(a)+1) = item
End If
Next
Next
Dim arr
a = Array(a,b,c,b,d,a,e)
Dim ret
Foreach item in a
Dim chk = False
For i = Lbound(a) To Ubound(a)
If a(i) = item Then
chk = True
End If
If Not chk Then
a(Ubound(a)+1) = item
End If
Next
Next
kero

Thu 2 Mar 2006 18:10:54
Thu 2 Mar 2006 18:10:54
ขอบคุณค่ะ

















