sort parameter values

sort parameter values

Anonymous
Not applicable
360 Views
2 Replies
Message 1 of 3

sort parameter values

Anonymous
Not applicable

Hi folks,

 

Im writing some code and found on google some VB.net sorting code but when i try to use it gives me an error.

 

ERROR: sort is not declared. The item may not be accessible as a result of the associated security level

 

anyone who knows what this means, what im i doing wrong? 

 

my code:

SyntaxEditor Code Snippet

Dim MyArrayList As New ArrayList
MyArrayList.add(X_Afstand_1_Ruit)
MyArrayList.add(X_Afstand_2_Ruit)
MyArrayList.add(X_Afstand_3_Ruit)
MyArrayList.add(X_Afstand_4_Ruit)

Sort(MyArrayList)
For Each Str As Double In MyArrayList
    MsgBox(Str)
Next 

Or if you have a better code for sorting values please tell me.

 

The thing is i always want the middle 2 values from the list no matter what but they need to be in order. Because i want to use them in mathformulas

Thanks in advance 

0 Likes
Accepted solutions (1)
361 Views
2 Replies
Replies (2)
Message 2 of 3

HermJan.Otterman
Advisor
Advisor
Accepted solution

Hello Lowie,

 

 

this works:

 

Dim MyArrayList(3) As Double
MyArrayList(0) = 43
MyArrayList(1) = 33
MyArrayList(2) = 6
MyArrayList(3) = 7

Array.Sort(MyArrayList)
For Each Str As Double In MyArrayList
    MsgBox(Str)
Next 

 

If this answers your question then please select "Accept as Solution"
Kudo's are also appreciated Smiley Wink

Succes on your project, and have a nice day

Herm Jan


Message 3 of 3

Anonymous
Not applicable

thank you very much made my code a bit easier

0 Likes