The input :
i = 768
arrayInt(i) = 258
arrayIntCombine(i) = 256
arrayByte(i) = 32
i = 1632
arrayInt(i) = 256
arrayIntCombine(i) = 112
arrayByte(i) = 97
i = 1824
arrayInt(i) = 259
arrayIntCombine(i) = 32
arrayByte(i) = 112
i = 1889
arrayInt(i) = 257
arrayIntCombine(i) = 97
arrayByte(i) = 112
i = 2016
arrayInt(i) = 260
arrayIntCombine(i) = 256
arrayByte(i) = 110
..... (more input)
I would like an output like this (text or messagebox):
No. 256 : 112 and 97
No. 257 : 97 and 112
No. 258 : 256 and 32
No. 259 : 32 and 112
No. 260 : 256 and 110
...... (more output)
I've tried array.sort from Sorting an array numerically (VB.NET) but it doesnt work
You could use Tuples:
Dim DictionaryOfTuples As New Dictionary(Of Integer, Tuple(Of Integer, Integer, Integer))
DictionaryOfTuples(768) =
New Tuple(Of Integer, Integer, Integer)(258, 256, 32)
DictionaryOfTuples(1632) =
New Tuple(Of Integer, Integer, Integer)(256, 112, 97)
DictionaryOfTuples(1824) =
New Tuple(Of Integer, Integer, Integer)(259, 32, 112)
DictionaryOfTuples(1889) =
New Tuple(Of Integer, Integer, Integer)(257, 97, 112)
DictionaryOfTuples(2016) =
New Tuple(Of Integer, Integer, Integer)(260, 256, 110)
Dim output As New System.Text.StringBuilder
For Each sortedTuple In DictionaryOfTuples.Values.OrderBy(Function(t) t.Item1)
output.AppendLine(
String.Format(
"No. {0} : {1} and {2}",
sortedTuple.Item1,
sortedTuple.Item2,
sortedTuple.Item3))
Next
MsgBox(output.ToString)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.