This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2009-12-17 10:05:59

saty
Scratcher
Registered: 2009-11-14
Posts: 7

File handling in scratch - file read and write

its gud that scratch 1.4 has ask and answer feature similar to scanf in C.

I love scratch with file handling features like
1)Creating a text file and storing data in it.
2) Retrieving data from a text file.

By this may be we can use scratch  with other languages like C, C++, PHP for example to save the HIGH SCORES of a game etc.


http://jayadeep.uni.cc/spaceship1.gif Spaceship 11
Enjoy this amazing adventure game

Offline

 

#2 2009-12-17 16:53:58

The-Whiz
Scratcher
Registered: 2007-07-09
Posts: 1000+

Re: File handling in scratch - file read and write

This is a good idea.

Offline

 

#3 2009-12-17 18:13:11

gershmer
Scratcher
Registered: 2009-02-12
Posts: 1000+

Re: File handling in scratch - file read and write

And it seems possible to.
Dun dun dun... reaching back into an oldie's memory...  http://www.chirp.scratchr.org/blog/?p=16 This is a mod of Scratch 1.2.1 that has a beta-list function with the ability to save lists as text files and import lists as text files.


Visit my site, Gershmer.net
Leave me a voicemail at my Google Voice number, [removed]

Offline

 

#4 2009-12-17 18:15:44

gershmer
Scratcher
Registered: 2009-02-12
Posts: 1000+

Re: File handling in scratch - file read and write

^ For anyone who needs to know, the .lst (which is just a renamed .txt) saves to /bin in that environment, but in the Scratch directory if it was being installed, not extracted.


Visit my site, Gershmer.net
Leave me a voicemail at my Google Voice number, [removed]

Offline

 

#5 2009-12-17 18:17:50

gershmer
Scratcher
Registered: 2009-02-12
Posts: 1000+

Re: File handling in scratch - file read and write

^ Wait, it's not a renamed txt file, my bad.


Visit my site, Gershmer.net
Leave me a voicemail at my Google Voice number, [removed]

Offline

 

#6 2009-12-18 10:49:08

saty
Scratcher
Registered: 2009-11-14
Posts: 7

Re: File handling in scratch - file read and write

yes this is working
the .lst file doesnt store in text format

i hope this feature comes in the next version of scratch.
so we can also store data files for persistence even in Scratch webpage


http://jayadeep.uni.cc/spaceship1.gif Spaceship 11
Enjoy this amazing adventure game

Offline

 

#7 2009-12-18 15:31:46

gershmer
Scratcher
Registered: 2009-02-12
Posts: 1000+

Re: File handling in scratch - file read and write

BTW, that Scratch 1.2 mod has one problem. You can't print/say lists as a whole, only as one item at a time. And there's no join[][] block because it's 1.2.  sad


Visit my site, Gershmer.net
Leave me a voicemail at my Google Voice number, [removed]

Offline

 

#8 2010-07-23 09:03:55

Daffy22
Scratcher
Registered: 2008-12-15
Posts: 500+

Re: File handling in scratch - file read and write

Hi I have downloaded this list mod of scratch and have managed to share the folder bin\ on a http:// server. I can now access it anywere! Is there a way I can get scratch to read a file from the http:// server?


http://img201.imageshack.us/img201/1784/logosmalle.png
"Spectacular - 5 Star" -  CNET.com Editor.

Offline

 

#9 2010-07-23 09:44:52

dav09
Scratcher
Registered: 2009-03-25
Posts: 1000+

Re: File handling in scratch - file read and write

well a hidden feature called write project summery as txt could could help design the first feature and an open/ close dialog for the 2nd, but its not as easy as that!

Offline

 

#10 2010-07-23 10:14:15

archmage
Scratcher
Registered: 2007-05-18
Posts: 1000+

Re: File handling in scratch - file read and write

I am not sure if people want other peoples' programs to generate .txt files on their pc. I think cookies would be a better idea.


Hi, I am Archmage coder extraordinaire. I do Scratch,pascal,java,php,html, AS2 and AS3. Leave me a message if you want coding advice. Also check out my personal website, lots of good stuff about web development, Flash, and Scratch (v1 and v2) !

Offline

 

#11 2010-07-23 10:23:09

Harakou
Community Moderator
Registered: 2009-10-11
Posts: 1000+

Re: File handling in scratch - file read and write

archmage wrote:

I am not sure if people want other peoples' programs to generate .txt files on their pc. I think cookies would be a better idea.

Good point. Maybe the project would have to ask permission before writing?


http://www.blocks.scratchr.org/API.php?action=random&return=image&link1=http://i.imgur.com/OZn2RD3.png&link2=http://i.imgur.com/duzaGTB.png&link3=http://i.imgur.com/CrDGvvZ.png&link4=http://i.imgur.com/POEpQyZ.png&link5=http://i.imgur.com/ZKJF8ac.png

Offline

 

#12 2010-07-23 11:41:06

coolstuff
Community Moderator
Registered: 2008-03-06
Posts: 1000+

Re: File handling in scratch - file read and write

Harakou wrote:

archmage wrote:

I am not sure if people want other peoples' programs to generate .txt files on their pc. I think cookies would be a better idea.

Good point. Maybe the project would have to ask permission before writing?

That would make sense. And maybe just show what the TXT file would like like, how large it is, etc. I know this topic is pretty old, but Lucario621 and I had a discussion about this a few days ago which lead to some pretty interesting ideas, notably, files that are only executable by Scratch projects that would act the same online as offline, and would even preserve your data between online -> offline usage.

It's funny how in the real world we don't have problems like this, people are pretty much fine with whatever any program will write on the computer. But when Scratch comes along, people think the projects are out to take over there computer. Probably because Scratch is available to people who both are and aren't dedicated to programming, whereas most programming languages are for people who are really serious about the programs they write.

Offline

 

#13 2010-07-23 18:36:48

tinoesroho
Scratcher
Registered: 2010-04-26
Posts: 100+

Re: File handling in scratch - file read and write

It's been done in Panther. Sorry to raise this old topic.


 Maurer Rose by TheVikings Should be featured. See the project in action here and my reasons here. 

Offline

 

Board footer