can you help me about multi items problem and text file problem ?

34 views
Skip to first unread message

Can

unread,
Feb 25, 2018, 8:29:05 PM2/25/18
to MIT App Inventor Forum
hello everyone. I have been using app inventor for a few months.  i dont know english thats why i am learning very slowly. I need to translate all learning documents for to understand. if i watch videos on youtube about app inventor tutorial i can do same thing but l do not understand why. anyway, probably I could not tell what I meant. 
Now. i have a problem. İ could not solved this problem. I try to solve for a long time. I have a list with 500+ sentences in it. I want to show each sentence as an individual item on a label one by one. İ can do all my want. but i write or coppy all of the sentences. I added 525 items to the list, I wrote a sentence for each item. It took a lot of time. It's not a one-time thing. I did the same thing in earlier applications.I do not want to do the same thing again. I am reading documents but I do not understand how to include a text file as a list. One has to tell me how to do it one by one.How to use the necessary blocks.? will items still appear on label one by one ? 
1.png
2.png
3.png
4.png
5.png
text file.txt

Chris Ward

unread,
Feb 26, 2018, 6:43:33 AM2/26/18
to mitappinv...@googlegroups.com
Hello Can

The issue is with the quality of the text file. For applications to import data, the data has to be consistent - human readable is great, but not sacrificing consistency.

The issues are:
1) Data is on every-other line (blank line between). It can be worked around but it is bad practice in the first place.
2) Some of the lines are split into two (for example lines 70, 113) - not acceptable.
3) Line 616 is split into several 'bullet point' lines - not acceptable. You can have this if all lines have sub-lines in this way, or if this type of line (sentence) is stored in a seperate file to the single-line data.

We cannot read your screenshots of the blocks. To make a screenshot that can be read, right mouse click in the Block Viewer and select "Download Blocks as Image".

See my example file "Modified_File.txt" attached and the Blocks Image below.


Modified_File.txt

Ghica

unread,
Feb 26, 2018, 6:49:56 AM2/26/18
to MIT App Inventor Forum
Here is an example.
I used your text file and uploaded it into my example app. 

At initialize the file is read. 
When the file is read, the text received is converted into a list, after taking out the empty lines the file seems to have. 

The button brings you from the first sentence to the next etc.
Cheers, Ghica.

loadtext.aia
Reply all
Reply to author
Forward
0 new messages