how to read/write data on Android?

J. Landman Gay jacque at hyperactivesw.com
Sun Mar 18 13:14:31 EDT 2012


On 3/18/12 4:47 AM, Nicolas Cueto wrote:
> Apologies for reposting this under a different subject but just cannot
> figure out what I am doing wrong.
>
> Having read about "specialFolderPath" in the Android release notes,
> here is the script from my Android test app that I thought would
> return  the "Hello world" contents of "file1.txt":
> ------
>   put url ("file:"&  specialFolderPath(“engine”)&  slash&  "file1.txt")
> into tData
>   put "If file1.txt is in engine-path, here are its contents:"&  cr&
> tData&  cr&  "--"&  cr into tResult

In this example, "engine-path" is not defined. Try something like this:

  put ("file:"&  specialFolderPath(“engine”)&  slash&  "file1.txt") into 
tPath
  answer "File exists:" && there is a file tPath -- confirms existence
  if there is a file tPath then
    put url tPath into tData
    put tData into fld 1 -- or whatever you want to do with it
  end if

Make sure you include a file named "file1.txt" in the Copy Files pane of 
the standalone builder.

-- 
Jacqueline Landman Gay         |     jacque at hyperactivesw.com
HyperActive Software           |     http://www.hyperactivesw.com





More information about the Use-livecode mailing list