Page 1 of 1

File input/output reading and writing to and from disc

Posted: Fri Nov 15, 2013 3:36 pm
by chris25
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

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

Posted: Fri Nov 15, 2013 6:12 pm
by Klaus
Could you please provide the COMPLETE link to the tutorial? Thanks!

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

Posted: Fri Nov 15, 2013 6:59 pm
by chris25

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

Posted: Fri Nov 15, 2013 7:23 pm
by Klaus
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

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

Posted: Fri Nov 15, 2013 8:26 pm
by Simon
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

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

Posted: Fri Nov 15, 2013 9:13 pm
by chris25
Sorry guys I thought this was something else.