Benel Halfon

unread,
Apr 16, 2015, 8:49:06 AM4/16/15
to mitappinv...@googlegroups.com
Hi :)
How check if file exists?
i tried this:
call File1.ReadFrom
filename
"file.txt"

when File1.GotText
do if is empty get text
call
File1.Save
text
"0"
fileName
"file.txt"

But it does not work... :/

Taifun

unread,
Apr 16, 2015, 10:29:21 AM4/16/15
to mitappinv...@googlegroups.com

use the Screen.ErrorOccurred block

btw. to read a file from SD card, you have to prefix the filename with a /, see also the documentation

Taifun


Trying to push the limits of App Inventor! Snippets and Tutorials from Pura Vida Apps by Taifun.         

fileExists.aia

Benel Halfon

unread,
Apr 17, 2015, 9:44:16 AM4/17/15
to mitappinv...@googlegroups.com
Hi Taifun!
thanks for the help!
----
1. how i check 2 files exists?
2. how to create dir?

Benel Halfon

unread,
Apr 19, 2015, 2:01:16 PM4/19/15
to mitappinv...@googlegroups.com
?

Taifun

unread,
Apr 19, 2015, 3:07:16 PM4/19/15
to mitappinv...@googlegroups.com
1. how i check 2 files exists?
just use the provided blocks to check 2 different files, you also can write a procedure and pass the file name as input parameter

first do the tutorials http://appinventor.mit.edu/explore/ai2/tutorials.html to learn the basics of App Inventor, then try something and follow the

2. how to create dir?
Reply all
Reply to author
Forward
0 new messages