Page 1 of 1

Specialfilefolder

Posted: Sun Nov 25, 2012 7:14 pm
by tyarmsteadBUSuSfT
I'm working on my first app with RunRev, and my app will be required to read from an existing file that I will include with the app as well as create a file that the the user can modify within the app. The app will be designed for Iphone, Ipad and Android. My question is when I am tell it where to look or create the file what path do I use?
Thank you,
Ty

Re: Specialfilefolder

Posted: Sun Nov 25, 2012 7:51 pm
by Mark
Hi Ty,

There are several ways to do this. You can include a file with the engine using the Copy Files tab of the Standalone Application Settings window. You could get the contents of the file with one of the following:

Code: Select all

put url ("file:" & specialfolderpath("engine") & "/filename.txt") into myData
put url ("binfile:" & specialfolderpath("engine") & "/filename.txt") into myData
You could also set a custom property to the data of that file. That saves you the trouble of getting around permission problems.

You can save a user document in the documents folder:

Code: Select all

put myData into url ("binfile:" & specialfolderpath("documents") & "/filename.txt")
Kind regards,

Mark

Re: Specialfilefolder

Posted: Sun Nov 25, 2012 8:44 pm
by tyarmsteadBUSuSfT
Thank you very much.

One followup, when the user saves info to a file do I also use the same concept? the file will hold previous lines of saved items and allows the user to delete specific lines.
Thank you again.

Re: Specialfilefolder

Posted: Sun Nov 25, 2012 9:36 pm
by Mark
Hi,

Yes, sure, it doesn't matter if you're just saving data once or reading, modifying and saving the data.

Best,

Mark

Re: Specialfilefolder

Posted: Mon Nov 26, 2012 1:55 pm
by Klaus
Hi guys,

this is everything but OFF-TOPIC (HINT, HINT!), so I will move this thread to the beginners section.


Best

Klaus