can’t find any info on a whole series of functions, like ss, ssc, etc. etc.
anyone can post any info about them? right this moment I need to easily pop words from the end of a string (maybe one of those functions can help avoid ugly substr/strlen/argc/arg formulas…)
In case they don’t, wouldn’t be nice to have a argm (multiple arguments) like: argm(“$mystring”,0,argc(“$mystring”)-1) ?
and that’s the easy task! if I need to splice out and replace item3 with itemwhatever, then that’s when it gets waaay too complex for an operation that should be simple.
I’ll write a script to do it, but it sure would be nice to have that argm and - since you’re at it - an argmx function (that works with separators other than " ")
totally agree that this would be nice. Until then you could also make use of the substitute expression in case you don’t have double entries in your list.
That would allow popping and splicing without too much complexity.
popping
set list = item1 item2 item3 item4 item5 item6
set partial = `substitute("$list",argx("$list",argxc("$list"," ")-1," "),"")`
splicing
set list = item1 item2 item3 item4 item5 item6
set partial = `substitute("$list",argx("$list",2," "),"item30")`
Yeah, I talked to dani about this approach too. It is easy to do some operations on lists when they are thrown into a single column table. It is easy to remove rows or splice in rows by name or index using the tab() expression and the table command.