Select item from a list with variable index

9 views
Skip to first unread message

Bastien D.

unread,
Apr 17, 2019, 9:10:14 AM4/17/19
to MIT App Inventor Forum

Hello everybody,

I have a list which have a variable length. 
I want to take every items from index 8 to index "length of the list".

How can I do that? 
Thank you !!
Bastien.

ABG

unread,
Apr 17, 2019, 12:18:16 PM4/17/19
to MIT App Inventor Forum
Did you want to generate a new list with only the items from 8 onwards?

Or did you want to do something to items 8+ onwards one by one?

Here's the first solution ...

set global EightOnwards to create empty list
for each n from 8 to length of list(MyInputList)
   add item (select item n from list MyInputList) to list global EightOnwards

ABG


Reply all
Reply to author
Forward
0 new messages