Forum

Get slice index?

hi all,

maybe a beginner’s question:

is there a way to check out the SLICE INDEX of a specific value in a spread of values automatically? i think of a kind of recursive “get slice” - node…

thanks for some hints how to solve this,

s-man

ha

have a look at @elektromeier
he made a module which exactly does what you want

–> GetIndex (Spreads).v4p

i´d think the proper term would be property list or dictionary (see http://www.nist.gov/dads/HTML/dictionary.html, and we´d yet failed to implement a clean one right way of doing this. several options exist:

for strings, the Sift node can help a lot.
for values a Select, = and I combination node would help you: Create a spread of integers with I, use = to compare your incoming value with the spread. Use select to retrieve a spread which contains only the slices where the = returns 1. depending on what you want to do, when no matches or multiple matches occur, use car, cdr, resample or bounds to fine tune the results.

meanwhile Sift (Value) makes this module obsolete.

hey, it’s a thread of 2004…

and there i was, thinking: oooh, someone asking about spreads, let’s get to it! :D