Dim strNames(5) As String
Dim i As Integer
strNames(0) = "Button7"
strNames(1) = "Button15"
strNames(2) = "Button14"
strNames(3) = "Button13"
strNames(4) = "Button12"
strNames(5) = "Button3"
How can I sort this array to this with sort method???? Is there a way?????
strNames(0)="Button3"
strNames(1)="Button7"
strNames(2)="Button12"
strNames(3)="Button13"
strNames(4)="Button14"
strNames(5)="Button15"
I have trying the following with no effect. Any help please???? Any help will be much appreciated.
Dim strNames(5) As String
Dim indx As Byte
Dim i, j As Integer
strNames(0) = "Button7"
strNames(1) = "Button15"
strNames(2) = "Button14"
strNames(3) = "Button13"
strNames(4) = "Button12"
strNames(5) = "Button3"
Dim str, strName as string
For i = 0 To strNames.Length - 1
If strNames(i).Length > 7 Then
str = strNames(i).Substring(strNames(i).Length - 2, 2)
indx = 2
ElseIf strNames(i).Length = 7 Then
str = strNames(i).Substring(strNames(i).Length - 1)
indx = 1
End If
For j = i + 1 To strNames.Length - 1
If strNames(j).Length > 7 Then
str = strNames(j).Substring(strNames(j).Length - 2, 2)
indx = 2
ElseIf strNames(j).Length = 7 Then
str = strNames(j).Substring(strNames(j).Length - 1)
indx = 1
End If
If Val(strNames(i)) > Val(strNames(j)) Then
strName = strNames(i).Substring(0, strNames(i).Length - indx) & str
strNames(i) = strNames(i).Substring(0, strNames(i).Length - indx) & str
strNames(j) = strName
End If
Next
Next
For i = 0 To strNames.Length - 1
Console.WriteLine(strNames(i))
Next
Thank you so much
in advanced.
Dim i As Integer
strNames(0) = "Button7"
strNames(1) = "Button15"
strNames(2) = "Button14"
strNames(3) = "Button13"
strNames(4) = "Button12"
strNames(5) = "Button3"
How can I sort this array to this with sort method???? Is there a way?????
strNames(0)="Button3"
strNames(1)="Button7"
strNames(2)="Button12"
strNames(3)="Button13"
strNames(4)="Button14"
strNames(5)="Button15"
I have trying the following with no effect. Any help please???? Any help will be much appreciated.
Dim strNames(5) As String
Dim indx As Byte
Dim i, j As Integer
strNames(0) = "Button7"
strNames(1) = "Button15"
strNames(2) = "Button14"
strNames(3) = "Button13"
strNames(4) = "Button12"
strNames(5) = "Button3"
Dim str, strName as string
For i = 0 To strNames.Length - 1
If strNames(i).Length > 7 Then
str = strNames(i).Substring(strNames(i).Length - 2, 2)
indx = 2
ElseIf strNames(i).Length = 7 Then
str = strNames(i).Substring(strNames(i).Length - 1)
indx = 1
End If
For j = i + 1 To strNames.Length - 1
If strNames(j).Length > 7 Then
str = strNames(j).Substring(strNames(j).Length - 2, 2)
indx = 2
ElseIf strNames(j).Length = 7 Then
str = strNames(j).Substring(strNames(j).Length - 1)
indx = 1
End If
If Val(strNames(i)) > Val(strNames(j)) Then
strName = strNames(i).Substring(0, strNames(i).Length - indx) & str
strNames(i) = strNames(i).Substring(0, strNames(i).Length - indx) & str
strNames(j) = strName
End If
Next
Next
For i = 0 To strNames.Length - 1
Console.WriteLine(strNames(i))
Next
Thank you so much
in advanced.