On Thu, 24 Jun 2010, Mathieu Bouchard wrote:
The trick is to use a [#slice] to extract the information to sort about ; however the [#slice] needs to know the height of the grid, so you need a [#dim]. the [#unpack] and msgbox is only one way to do it in two steps : you can also do [# * (1 0)] [# + (0 1)] and there are a bunch of other equivalent ways. Then, when you have a grid of size (n 1) and you need to get it to size (n), you'd do something like [#fold +] or [#fold put],
Actually, in the case where you only want the last column, you can skip [#slice] and [#dim] and just use [#fold put].
Therefore, if you only want the last column, you can flip the grid using [#reverse 1] before using [#fold put].
And if you know the number of columns in advance, you can select the column using a one among zeroes, as in [#inner (5 # 1 0 0 0 0)], which in this case is the same as [# * (1 0 0 0 0)] then [#fold +] (this equivalence only works with simple cases of #inner, those where the right-inlet has only one dim)
_ _ __ ___ _____ ________ _____________ _____________________ ... | Mathieu Bouchard, Montréal, Québec. téléphone: +1.514.383.3801