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

#1 2010-12-02 11:18:32

TornFusion
Scratcher
Registered: 2010-09-03
Posts: 1000+

Write [] to file [] block?

What does Write [] to file [] block in Panther do? I don't get how to use it, can you use pictures too to show?

Offline

 

#2 2010-12-02 11:29:02

TornFusion
Scratcher
Registered: 2010-09-03
Posts: 1000+

Re: Write [] to file [] block?

bump

Offline

 

#3 2010-12-02 14:05:42

sparks
Community Moderator
Registered: 2008-11-05
Posts: 1000+

Re: Write [] to file [] block?

hey! The [write [s] to file [s]] block allows you to "paste" text into a file on your computer.

here's a demo tutorial I've put together for you:

1) open notepad or wordpad or some similar bare text editor (don't use word or scribe)

2)save the blank file as "example.txt" anywhere you like.

3) Find your text file on your computer now it's saved and right-click > properties to find the file path if you don't know it (e.g. C:\Documents and Settings\My Documents\example.txt)

4) Open a copy of Panther 1.0 and drag out a [write [s] to file [s]] blocks and type out/paste the file path to your blank text file (make sure you get it right and don't forget to always add the format (in this case .txt) to the end of the path.

5) type "hello world", "test", "goodbye cruel world" or any other quirky message you like into the first space on the block.

6) run the block (click it or attatch it to to a hat so that you get a white edge on it.

7) open your test.txt file and you should see your message has been pasted into that file.
_____________________________________________-

uses:

this method allows you to save data without saving the project - excellent for high scores and the like.

using the (contents of file []) and (line () of file []) blocks, you can read the information back!
________________________________________________________-

tips:

you don't have to use .txt as your file type. You can make up your own like PSF (panther save file) or a random one like .dfh5 as long as you put that type at the end of the path in the blocks you use!

if you use the [clear file [ ]] block (which normally clears the contents of a file completely (be careful not to clear something important!)) but type in a file path to a file that does not exist, a glitch in the Panther code means that that file is created for you!

if you don't give a file path (e.g. just type test.txt into one of the file reading/writing blocks, it will refer to a default path, which is the folder on your computer containing the "panther.image" file.
____________________________________________________

hope that helps! any more questions, feel free to ask!

Sparks

Last edited by sparks (2010-12-02 14:07:26)


http://img541.imageshack.us/img541/7563/scratchbetabanner.png

Offline

 

#4 2010-12-07 15:42:21

bbbeb
Scratcher
Registered: 2009-06-11
Posts: 1000+

Re: Write [] to file [] block?

.psf = photoshop secondary file. XD


Back in my day.... there were no laws that censored the internet... now, there are.... nah.

Offline

 

#5 2010-12-07 16:31:43

sparks
Community Moderator
Registered: 2008-11-05
Posts: 1000+

Re: Write [] to file [] block?

bbbeb wrote:

.psf = photoshop secondary file. XD

Not anymore!  big_smile


http://img541.imageshack.us/img541/7563/scratchbetabanner.png

Offline

 

#6 2010-12-12 14:51:41

bbbeb
Scratcher
Registered: 2009-06-11
Posts: 1000+

Re: Write [] to file [] block?

bbbeb wrote:

.psf = photoshop secondary file. XD

XD


Back in my day.... there were no laws that censored the internet... now, there are.... nah.

Offline

 

Board footer