2015년 1월 1일 목요일

Reading a single line

How do I read specific lines from a text file? For example, how would I read line 2 only of a text file? This is app inventor 2



you can't read a single line with the file component, but this actually isn't necessary..
just read the complete file, split it at \n (new line) and store the result in a list in the File.GotText event like this:

set global myList to split at get text
                                        \n

later to get the 2nd line, use the select list item block then to select item 2


댓글 없음:

댓글 쓰기