none
Crash by sort array with the ldextention from litdev RRS feed

  • Question

  • Hi litdev,

    i have 2 problems with the array sort. Show program ZRP052. I marked the row with <- and a notice. Is the mistake by me or is the crash in your extention? I hope you can help me.

    Sorry for my bad english.


    Best Regards Martin

    Thursday, June 21, 2012 6:04 PM

Answers

  • I need to add a method to sort an LDArray - I will do this.  Sorting an array of more than one dimension may be tricky.

    What would a sort on this array look like?

    test[1][1] = 5
    test[1][2] = 4
    test[2][1] = 3
    test[2][2] = -1
    test["Hello"][2][1] = 1

    EDIT

    I have uploaded a new version (1.0.0.22) with a LDArray.Sort method


    • Edited by litdevModerator Thursday, June 21, 2012 8:32 PM
    • Marked as answer by martmen Sunday, July 22, 2012 12:24 AM
    Thursday, June 21, 2012 7:05 PM
    Moderator

All replies

  • Hi Martin,

    The problem is mixing the LDArray and LDSort methods.

    The LDArray is for large arrays (fast compared to standard SmallBasic arrays).

    The LDSort only acts on standard SmallBasic arrays; hence the following works:

    B = LDSort.ByValue(A) '<- Dump by this line
    For i = 1 To LSA 
       X = A[i] + "     " + B[i]
      TextWindow.WriteLine(X)
    EndFor
    Perhaps I will add sorting capabilities to the LDArray method.

    Thursday, June 21, 2012 6:34 PM
    Moderator
  • Hi litdev,

    Ok, it works fine. It is possible to sort a LDArray and it is possible to sort a array with more then 1 dimension?

    Thank you for you quick answer. I am a fan for you.


    Best Regards Martin

    Thursday, June 21, 2012 6:46 PM
  • I need to add a method to sort an LDArray - I will do this.  Sorting an array of more than one dimension may be tricky.

    What would a sort on this array look like?

    test[1][1] = 5
    test[1][2] = 4
    test[2][1] = 3
    test[2][2] = -1
    test["Hello"][2][1] = 1

    EDIT

    I have uploaded a new version (1.0.0.22) with a LDArray.Sort method


    • Edited by litdevModerator Thursday, June 21, 2012 8:32 PM
    • Marked as answer by martmen Sunday, July 22, 2012 12:24 AM
    Thursday, June 21, 2012 7:05 PM
    Moderator