Splice ( delimitedList ; start ; stop ; step )
Splices values out of a list given a starting point, stopping point, and an increment (step). Similar to Python's list[] notation.
Average rating: 5.0 (1 vote) Log in to vote
Ethan - Show more from this author
Tactile Medical https://www.linkedin.com/in/ethyoder |
Splice ( List ( "a" ; "b" ; "c" ; "d" ) ; 1 ; -1 ; "" )
Splice ( List ( "a" ; "b" ; "c" ; "d" ) ; "" ; -3 ; -1 )
Splice ( List ( "a" ; "b" ; "c" ; "d" ) ; "" ; "" ; 2 )
"a¶b¶c"
"d¶c"
"a¶c"
Function definition: (Copy & paste into FileMaker's Edit Custom Function window)
All non-list parameters *must* be integers. Start and stop cannot be 0 as FM list convention starts lists at index 1.
This should work like splicing lists in Python (except lists start at index 1 in FM), so you should be able to...
- leave first value blank (iteration starts at beginning of list)
- leave last value blank (iteration ends at and *includes* last value of list)
- use negative indexes to refer to values at the end of lists (-1 = last value, -2 = 2nd to last value, etc.)
- leave step value blank (iterate forward by 1)
- iterate backward (negative step values)
- iterate by more than 1
Comments
Note: these functions are not guaranteed or supported by BrianDunning.com. Please contact the individual developer with any questions or problems.