How to open a file?

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Klaus
Posts: 14190
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: How to open a file?

Post by Klaus » Thu Oct 21, 2021 6:21 pm

If you have a field in your LC app that you have modified and want to write it to a file on the mobile platform:

Code: Select all

...
## This folder-> specialfolderpath("documents") is the only folder where we have write permission on the mobile platform!
## 1. Define a filename:
put specialfolderpath("documents") & "/name_for_your_text_file_her.txt" into tFileName

## 2. Now put the content of your field into that file:
put fld "Name of your field here" into url("file:" & tFileName)
...
If that is not what you want please be much more specific!

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10094
Joined: Fri Feb 19, 2010 10:17 am

Re: How to open a file?

Post by richmond62 » Thu Oct 21, 2021 6:26 pm

So what is the code I need to write?
code for what?
-
SShot 2021-10-21 at 20.24.49.png
-
I suppose in your language you do have manners.

It would be good if you learnt a few in English.
Attachments
Texter.livecode.zip
Here's the text.
(1.1 KiB) Downloaded 154 times

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10317
Joined: Wed May 06, 2009 2:28 pm

Re: How to open a file?

Post by dunbarx » Thu Oct 21, 2021 6:30 pm

Hi.

I am with Klaus here, in that if at all possible, simply place your text into a field. You then have direct access to that field, and do not need to leave the stack at all. Fields can hold any amount of text, can be of any size and format, and you can place that field anywhere you want, even on another stack that is built only to hold the field itself.

Craig

Post Reply