android - Show .txt file line by line in App Inventor 2 -
i read txt file , show line line in app inventor 2, don't know components/blocks use.
something these
choose .txt reading > show first line > press button > show second line
this blocks try use , still no idea sorry, if didn't help
ploy, can below:
firstly, need create global empty list. next, global lineindex variable indicate number of lines shown. lastly, have configure maxindex number refer maximum lines in file.
then, @ screen1.initialize call file1.readfrom function. can specify own file name. yet, please make sure saved in .csv format. contain of file such below:
in example, i'm using 2 different buttons. 1 button read file , button reset global lineindex countdown. first image, can see in when read_button.click part, have set global lineindex countdown increase automatically 1 after read_button clicked.
then, safety reason, have add check "if , else" statement. result_label show contain in file if lineindex countdown not exceed maximum line in file.
that's it.
Comments
Post a Comment