2016년 11월 22일 화요일

мне нужна ваша помощь при работе со списком (I need your assistance in working with a list)


имеется список папок. например : 
(a list of folders. eg :)
/storage/sdcard1/Pictures/a
/storage/sdcard1/Pictures/b
/storage/sdcard1/Pictures/c
/storage/sdcard1/Pictures/d
и так далее. 
(and so on.)
как получить список вида: 
(how to get a list of the form:)
a
b
c
d

используя блок 'for each item in list' , либо как-то по другому. 
(Using 'for each item in list' block or somehow differently.)
у меня 
ни как не получается. 
(It does not work.)  
подскажите

-- 
Google translate is not very kind to your text, so maybe I do not understand, but I think Taifun's file extension will help: http://puravidaapps.com/file.php
Cheers, Ghica.

-- 
именно с помощью указанного расширения я получил список директорий 
(it is through this extension, I received a list of directories)

/storage/sdcard1/Pictures/a , 
/storage/sdcard1/Pictures/b , 
/storage/sdcard1/Pictures/c , 
/storage/sdcard1/Pictures/d  

которые находятся в /storage/sdcard1/Pictures/. 
(which are in the / storage / sdcard1 / Pictures /.)

теперь мне нужно получить список названий директорий (a,b,c,d) , без /storage/sdcard1/Pictures/ 
(now I need to get a list of folders (a, b, c, d) the names, without / storage / sdcard1 / Pictures /)

-- 
You take the list that you have as result from the file extension. You use the for each element in list block, and in the do part you split the text on / , which gives you a list and you take the last element of that to add to your listpicker.

Some documentation about lists:
List Blocks, by Sajal Dutta:
http://www.imagnity.com/tutorials/app-inventor/list-blocks-on-app-inventor/

Chapter 19 of the App Inventor book:
http://www.appinventor.org/bookChapters/chapter19.pdf

Displaying a list:
http://ai2.appinventor.mit.edu/reference/other/displaylist.html

Cheers, Ghica.



-- 
 
я сделал вот так. но у меня получается список в обратном порядке. 
(I did like that. but I get the list in reverse order.)

-- 
Your global index is probably 0, therefore you are inserting each item at position one, which gives you the list in reverse order.
Use the add item to list block instead.
Cheers, Ghica.

-- 
большое спасибо. это работает как надо. 
(many thanks. it works as it should.)

-- 

댓글 없음:

댓글 쓰기