set Textbox1.Text to File1.ReadFrom "myFile.txt"
ReadFrom(text fileName)
You should use the GotText block
Set TextBox1.Text to File1.Text
Set TextBox1.Text to File1.Text
found it file got text block didnt realise when you hover over the the small square saying text it gives the get text box. sorted :-)
I think i have the same (or similar) problem. I have a csv file contains more than 150 data. I want to read data from that file and write to a label (or text block). I found some workarounds for this issue but i couldn't find any sample/tutorial for the usage of "file" block. Is there any sample?
@Bob: so why don't you just try what I recommended to use in this thread?
set Label1.Text to File1.ReadFrom "//myFile.txt"To read assets packaged with an application (also works for the Companion) start the filename with // (two slashes)
Finally, i read the file with defining the file name as /AppInventor/assets/File.cs v . It worked.
But i guess i have another logical problem. My "File.csv" document is on my phone. When i compile the code and send to another phone, program try to get an item from empty document and fails. So, can i use File.csv in another phone after compiling.
upload your csv file as asset into your app, then use this path to your csv file
//File.csv
To read assets packaged with an application (also works for the Companion) start the filename with // (two slashes)
can u upload an image of ur work plz
?!!
댓글 없음:
댓글 쓰기