Create folder and files on first launch (avoiding error 2101)

375 views
Skip to first unread message

Enora Nedelec

unread,
Jul 26, 2015, 6:33:56 AM7/26/15
to mitappinv...@googlegroups.com

Based on advices provided by Taifun, Scott and Steve in the forum, here is the best way (sor far) I found to create the two files (stored inside folder in the private folders) that are needed for my app.





The if/then with TinYDb FIRSTRUN isn't always necessary. I personally don't use it (but I still keep the local variable to create the folder with the canvas, yes this will run at each launch) but I  thought I would let it in the example to give this ideas to some. 



Below is my first try to create a folder and a file. But I choose, for my current app, the method above because the one below doesn't work when you want to need two files : if one file is deleted, then you will have get the error 2101 and both you file will be set to empty. 

 




The third method mentioned in the comment is the one is in picture above. 




Scott Ferguson

unread,
Oct 19, 2015, 12:43:47 AM10/19/15
to MIT App Inventor Forum
Interesting way to create a file by appending empty text.
---
sf
Reply all
Reply to author
Forward
0 new messages