Announcement

Collapse
No announcement yet.

Array Sort Annoyances...

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Array Sort Annoyances...

    This time there *appears* to be an actual issue...

    Before I formally submit it I figured I'd check is anyone else had the same problem

    When using array sort on a string array that went from 0 to 24, Array Sort apparently didn't like it.

    Fortunately element "25" was blank - so when it sorted, element 0 became blank (as it should) and everything dropped down 1 element - but I "lost" one of the values

    the code was similar to this:

    Code:
    dim somearray(1) as string
    '
    'some code
    '
    redim somearray(25)   'should give 0 to 24
    for i=0 to 24
     somearray(i) = str$(i) + "a string"
    next i
    
    ARRAY SORT somearray()
    REDIMming the array from 1 to 25 apears to have solved the problem.

    Anyone else come across this? Before I send in a bug report?
    John,
    --------------------------------
    John Strasser
    Phone: 480 - 273 - 8798

  • #2
    John,
    redim somearray(25) 'should give 0 to 24
    No, it gives 0 to 25.
    You can check by printing out UBOUND(somearray()) and LBOUND(somearray()) after you redim the array.

    Paul.

    Comment


    • #3
      Have you tried:

      Array Sort SomeArray(0) for 24 (or 25)
      There are no atheists in a fox hole or the morning of a math test.
      If my flag offends you, I'll help you pack.

      Comment


      • #4
        You're right Paul.

        Right there under DIM...



        And Mel - I thought I tried that. But I'll try again tomorrow

        Thanks.
        John,
        --------------------------------
        John Strasser
        Phone: 480 - 273 - 8798

        Comment

        Working...
        X