Clause: #1029711
Hi all,
I’ve been working more with @for recently, in part thanks to advice I got from @robbert.jacobs on previous forum posts.
I have created a clause that tallies the amounts of shares across multiple series and automatically assigns consecutive numbers to them.
For example, if 25.000 common stock exist, and series 1 adds 1.000 shares, and series 2 adds another 2.000 shares, then:
series 1 will have the number 25.001 - 26.000, and
series 2 will get 26.001 - 28.000
Below is my working version of this logic:
What I like about this is that users only need to input the series name and amount, and the rest gets filled automagically.
However, I still feel that my calculators for the starting and ending numbers could be better:
// — Share Starting Amount Calculator — //
X-START = {1 + #shares^common-stock-initial + @get(#share-series^amount-issued, ?X -1) + @get(#share-series^amount-issued, ?X -2) + @get(#share-series^amount-issued, ?X -3) + @get(#share-series^amount-issued, ?X -4) + @get(#share-series^amount-issued, ?X -5)}
// X-START: using @get(?X -1) allows me to display the total sum of all preferred series, minus the ones whos index has not been called yet
// — Share Ending Amount Calculator — //
X-END = {#shares^common-stock-initial + @get(#share-series^amount-issued, ?X) + @get(#share-series^amount-issued, ?X -1) + @get(#share-series^amount-issued, ?X -2) + @get(#share-series^amount-issued, ?X -3) + @get(#share-series^amount-issued, ?X -4)}
// X-END: same logic as X-START, but adding the current preferred amount to the iteration
My idea in building it this way was that on the first loop, ?X - 1 would result in @get-ting “nothing” from the list, whilst on the second loop, ?X -1 would @get the first item.
My question here is can I streamline X-START and X-END ? I feel like I am using @get a bunch of times. I kind of feel like I did when I wrote a previous post, again limiting the amount of loops allowed because I don’t want to manually account for more than 5
Thanks!