31 lines
752 B
Plaintext
31 lines
752 B
Plaintext
' Set the data.
|
|
dataArray[1] = 1
|
|
dataArray[2] = 2
|
|
dataArray[3] = 2
|
|
dataArray[4] = 3
|
|
dataArray[5] = 4
|
|
dataArray[6] = 5
|
|
dataArray[7] = 5
|
|
|
|
resultArray[1] = dataArray[1]
|
|
lastResultIndex = 1
|
|
position = 1
|
|
While position < Array.GetItemCount(dataArray)
|
|
position = position + 1
|
|
isNewNumber = 1 ' logical 1
|
|
resultIndex = 1
|
|
While (resultIndex <= lastResultIndex) And isNewNumber = 1
|
|
If dataArray[position] = resultArray[resultIndex] Then
|
|
isNewNumber = 0
|
|
EndIf
|
|
resultIndex = resultIndex + 1
|
|
EndWhile
|
|
If isNewNumber = 1 Then
|
|
lastResultIndex = lastResultIndex + 1
|
|
resultArray[lastResultIndex] = dataArray[position]
|
|
EndIf
|
|
EndWhile
|
|
For resultIndex = 1 To lastResultIndex
|
|
TextWindow.WriteLine(resultArray[resultIndex])
|
|
EndFor
|