File input/output reading and writing to and from disc

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: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
chris25
Posts: 354
Joined: Tue Oct 08, 2013 9:32 pm

File input/output reading and writing to and from disc

Post by chris25 » Fri Nov 15, 2013 3:36 pm

Quoted by Simon: Here is the lesson for a simple text file:
http://lessons.runrev.com/s/lessons/m/4 ... put-output

Read with interest this post. Just so that I understand things correctly, does this particular tutorial deal with, by way of a practical example, say I had a huge data file culled from the internet that lists all RGB, L*A*B and CMYK values for a given colour space; I could include this file as a part of the application (stored independently on a user's hard drive) and the actual stack I code would refer to this file? in as much as the user would insert a single line or integer and then receive a result. Is this what all this is about? Does this deal only with static data files and not with data files that are updated constantly within the global network (ie the news)?

Thankyou
chris

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

Re: File input/output reading and writing to and from disc

Post by Klaus » Fri Nov 15, 2013 6:12 pm

Could you please provide the COMPLETE link to the tutorial? Thanks!


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

Re: File input/output reading and writing to and from disc

Post by Klaus » Fri Nov 15, 2013 7:23 pm

Hi Chris,
chris25 wrote:Quoted by Simon: Here is the lesson for a simple text file:
http://lessons.runrev.com/s/lessons/m/4 ... put-output
ah, thanks!

Since I am a lazy guy, I got used to the URL syntax with file handling.
Instead of:
open file ...
write "THis is text" to file...
or
read from file...
close file...

I use the one-liner to write to disk:
...
put "This is text" into url("file:" & specialfolderpath("documents") & "/a_text_file.txt")
...
Resp. to get a file from disk:
...
put url("file:" & specialfolderpath("documents") & "/a_text_file.txt") into fld "test text file"
...
chris25 wrote:Read with interest this post. Just so that I understand things correctly, does this particular tutorial deal with, by way of a practical example, say I had a huge data file culled from the internet that lists all RGB, L*A*B and CMYK values for a given colour space; I could include this file as a part of the application (stored independently on a user's hard drive) and the actual stack I code would refer to this file? in as much as the user would insert a single line or integer and then receive a result. Is this what all this is about? Does this deal only with static data files and not with data files that are updated constantly within the global network (ie the news)?
Sorry, I don't have the slightest idea what you mean :D

The tutorial is about writing/reading data (of whatever kind!) to/from the users harddisk.


Best

Klaus

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: File input/output reading and writing to and from disc

Post by Simon » Fri Nov 15, 2013 8:26 pm

Hi Chris,
Klaus's way is the way I use reading and writing to a file. I just couldn't find a lesson on that method.

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

chris25
Posts: 354
Joined: Tue Oct 08, 2013 9:32 pm

Re: File input/output reading and writing to and from disc

Post by chris25 » Fri Nov 15, 2013 9:13 pm

Sorry guys I thought this was something else.

Post Reply