• Using SUBSEP; why? (Was: Use multi-dimensional arrays, Luke! (Was: asor

    From Kenny McCormack@21:1/5 to manchon.lm@gmail.com on Thu Aug 12 17:09:59 2021
    In article <24b17405-ad5d-46e9-8d07-46917097b34cn@googlegroups.com>,
    Laurent MANCHON <manchon.lm@gmail.com> wrote:
    --
    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];


    And then what?

    I don't know if you've ever really explained what it is you're doing, but
    let me just say that whever I see "SUBSEP" in user code, I assume that the programmer is trying to create a subscript in a pseudo-multi-dimensional
    array. If that is the case for you and your code, then I'd argue that you shouldn't be doing that, since you could be using real-multi-dimensional
    arrays instead.

    However, sometimes programmers use SUBSEP as a quick-and-dirty separator
    for data, arguing that it is more or less guaranteed to never occur in
    data, having nothing to do with pseudo-multi-dimensional arrays. This
    usually works but is confusing to the reader of the code, since it looks
    like array stuff.

    Personally, I usually end up using ^A when I need a fake data separator.

    Is there any particular reason why you are using SUBSEP in the code above?

    --
    Mike Huckabee has yet to consciously uncouple from Josh Duggar.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Laurent MANCHON@21:1/5 to All on Thu Aug 12 12:01:50 2021
    --
    absolutely, I use SUBSEP as a concatenation separator.
    I could have declared SUBSEP=";" in the begin statement for more security.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Ed Morton@21:1/5 to Laurent MANCHON on Fri Aug 13 11:09:03 2021
    On 8/12/2021 2:01 PM, Laurent MANCHON wrote:
    --
    absolutely, I use SUBSEP as a concatenation separator.
    I could have declared SUBSEP=";" in the begin statement for more security.


    Please include enough context in your posts so those of us trying to
    follow them on usenet know what they're about. See the posts from
    everyone else in this thread for examples of that.

    Ed.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Laurent MANCHON@21:1/5 to All on Fri Aug 13 09:24:56 2021
    i think i understood.
    in C you have to anticipate the size of the memory you will need. You don't know in advance how many concatenations you have to do.

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