get contents file

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: Klaus, FourthWorld, heatherlaine, kevinmiller

Post Reply
link76
Posts: 98
Joined: Fri Nov 04, 2011 1:52 pm

get contents file

Post by link76 » Fri Oct 04, 2019 2:08 pm

I save my map file (map.html) in the special folder to be displayed in the mobile device browser and works perfectly!

I would like to retrieve the contents of the map.html file in my device mobile, so that it can modify it.

Trying this motion I recover only the url of the route.

Code: Select all

set the defaultFolder to specialFolderPath("documents")
put "url:" & defaultfolder & "/map.html" into contentsMapFile
....
replace "aaaaaa," with "bbbb" in contentsMapFile 
thanks

Klaus
Posts: 11416
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: get contents file

Post by Klaus » Fri Oct 04, 2019 2:16 pm

1. No need to set the defaultfolder.
2. You forgot the FILE: in the URL function
3. URL is a LC function, so NO quotes here!
Do this:

Code: Select all

...
put URL("file:" & specialFolderPath("documents") & "/map.html") into contentsMapFile
....
replace "aaaaaa," with "bbbb" in contentsMapFile 
...
## Write back if neccessary:
put contentsMapFile into URL("file:" & specialFolderPath("documents") & "/map.html")
...
You will find all this in the dictionary! 8)

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”