Sort Integer Array

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Bob Palank

    Sort Integer Array

    ' Given

    Dim v(19) As Integer ' a 20 element array

    Dim vSorted(19) As Integer

    Dim i As Integer

    ' The array v() is filled with random numbers

    ' It is then copied into vSorted()

    then

    Array.Sort(vSor ted) ' is attempted but it seems to be a string sort

    ' and not a numeric sort.

    ' So in vb.net 2008, how does one code a numeric sort ?

    BR

    Bob


  • =?Utf-8?B?QU1lcmNlcg==?=

    #2
    RE: Sort Integer Array

    It works for me. I suggest you run in the debugger with breakpoints before
    and after Array.Sort(vSor ted) and see what is happening.

    "Bob Palank" wrote:
    ' Given
    >
    Dim v(19) As Integer ' a 20 element array
    >
    Dim vSorted(19) As Integer
    >
    Dim i As Integer
    >
    ' The array v() is filled with random numbers
    >
    ' It is then copied into vSorted()
    >
    then
    >
    Array.Sort(vSor ted) ' is attempted but it seems to be a string sort
    >
    ' and not a numeric sort.
    >
    ' So in vb.net 2008, how does one code a numeric sort ?
    >
    BR
    >
    Bob
    >
    >
    >

    Comment

    Working...