• Use multi-dimensional arrays, Luke! (Was: asort function)

    From Kenny McCormack@21:1/5 to manchon.lm@gmail.com on Thu Aug 12 14:54:15 2021
    In article <a7bfa7f2-27c8-4d67-a11f-3fc90653e6bfn@googlegroups.com>,
    Laurent MANCHON <manchon.lm@gmail.com> wrote:
    typically this kind of concatenation:
    ...
    if(!(list[i])){list[i]=array[i,j];}
    else{list[i]=list[i] SUBSEP array[i,j];}


    Well, there's your problem, right there.

    If you are using either TAWK or GAWK (which you clearly are), then you
    should not be using the old-fashioned SUBSEP-based pseudo-multi-dimensional arrays. Use real, true multi-dimensional arrays - like a big boy!

    --
    The randomly chosen signature file that would have appeared here is more than 4 lines long. As such, it violates one or more Usenet RFCs. In order to remain in compliance with said RFCs, the actual sig can be found at the following URL:
    http://user.xmission.com/~gazelle/Sigs/DanQuayle

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Laurent MANCHON@21:1/5 to All on Thu Aug 12 08:04:04 2021
    --
    Sure Tawk can do that ?
    --

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Laurent MANCHON@21:1/5 to All on Thu Aug 12 09:29:20 2021
    --
    i confirm, it works i have changed array[i,j] to array[i][j]
    and the concatenation step to:

    list[i]=list[i] SUBSEP array[i][j];

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Kenny McCormack@21:1/5 to manchon.lm@gmail.com on Thu Aug 12 16:23:16 2021
    In article <2ecbd17e-24b0-427a-ad81-28b05641463dn@googlegroups.com>,
    Laurent MANCHON <manchon.lm@gmail.com> wrote:
    --
    Sure Tawk can do that ?
    --

    yes.

    --
    To most Christians, the Bible is like a software license. Nobody
    actually reads it. They just scroll to the bottom and click "I agree."

    - author unknown -

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)