Survey over - no need for any more replies thanks
Please reply in a Hide Details section so that your don't influence other peoples reply
Summary
This text will be hidden
Survey over - no need for any more replies thanks
Please reply in a Hide Details section so that your don't influence other peoples reply
This text will be hidden
EDIT: i imported the block into the editor, it has a default value of 1 for the right slot, so this guess is probably what you were thinking or wherever you got this block from
Get the index of thing in list
Off-topic: I found this on wikipedia
Off topic, your "Details" section headings seems to be localized (PL).
If I saw that, I would guess it would grab the index of thing in the list. If the list input wasn't a list input, I'd have no idea what it would do.
If thing is in the list, it returns the (first if thing is in there more than once) index of thing in the list; otherwise, 0.
e.g.
set [list] to (list [Alpha] [Bravo] [Charlie] [Delta] [Bravo])
((list) index [Alpha]) = 1
((list) index [Bravo]) = 2
((list) index [Charlie]) = 3
((list) index [Delta]) = 4
((list) index [Echo]) = 0
This reporter, I feel like, should report the value at the key of βthingβ in the provided dictionary. If the key does not exist, then the reporter returns an error.
Right now? Judging that its a list block, it would say it indexes the item in a list, like the index block
If i didn't know what the index block did, then i would not know.
Report the index of thing (1st appearance) within the referenced list.
Thanks for all the replies
Most people thought it would give the same as index of (thing) in (list) which is what I wanted to communicate
OK β¦ so why bother inventing a new block mimicking an existing Snap! primitive?
I was looking for a physically smaller reporter to do the same job
How about the APL-ish: ?
The index of x in list
Nice but I don't think that will mean much to most people.
But @qw23 you got me thinking - is there an exisiting APL reporter that returns the index and there is
so maybe I could use
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.