List Commands Library for 50g

03042018, 05:49 PM
(This post was last modified: 03042018 05:52 PM by DavidM.)
Post: #266




RE: List Commands Library for 50g
(03042018 04:51 PM)pier4r Wrote: Thanks for sharing, then go for it. If the input checking routines already there, tested and easy to use, why not. Of course, now I have another dilemma: seems like I should also accommodate reals and exact integers as well for SPLIT/RSPLT. Much to my dismay, it actually makes sense to do those  it's easy to see where they could be useful. Gets a bit more complicated, though. What should the proper result be if the following is attempted? 123.456 2 SPLIT (I'm guessing most would expect 12 3.456) Ok, now how about: 123.456 4 SPLIT or 1.23456E99 4 SPLIT or 123.456E3 4 SPLIT ...at least exact integers seem a bit more straightforward to interpret. There's just one "wrinkle" I can think of, and it also applies to reals: when the "split point" is at either end of the number, the "opposing chunk" needs to have some kind of value, and to me it seems like it should be 0. That would be in keeping with the list and string versions, which create null versions of their base type. 0 seems like the most reasonable choice for a numeric "null" in this situation. Edit: just thought of another wrinkle: negative numbers! If a negative number is split, should either/both/none of the results be negative? 

« Next Oldest  Next Newest »

User(s) browsing this thread: 2 Guest(s)