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

#1 2010-04-13 19:22:00

Jakey22
Scratcher
Registered: 2008-12-28
Posts: 72

File I/O block

I was wondering how to make file input output blocks, like the ones to be in panther. I am really impatient and if anyone knows how, please post the code. Thanks!!!


http://www.imagebookers.com/gallery/d/2561-1/ubuntu-wallpaper.png http://bullylug.org/linux-penguin.jpg
My website       PENGUINS!!!!!!!!!!!!!!!!!!!!! randomness.

Offline

 

#2 2010-04-13 19:29:32

SeptimusHeap
Scratcher
Registered: 2010-02-01
Posts: 1000+

Re: File I/O block

Stop stealing our ideas. COPYCAT.


http://i46.tinypic.com/dw7zft.png

Offline

 

#3 2010-04-13 19:33:02

Jakey22
Scratcher
Registered: 2008-12-28
Posts: 72

Re: File I/O block

You should be proud. THERE GOOD ONES!!!


http://www.imagebookers.com/gallery/d/2561-1/ubuntu-wallpaper.png http://bullylug.org/linux-penguin.jpg
My website       PENGUINS!!!!!!!!!!!!!!!!!!!!! randomness.

Offline

 

#4 2010-04-13 19:43:26

cds56
Scratcher
Registered: 2008-05-02
Posts: 500+

Re: File I/O block

Jakey22 wrote:

You should be proud. THERE GOOD ONES!!!

They're good ones....


http://img192.imageshack.us/img192/909/meowdevlogo.pnghttp://i32.tinypic.com/pucti.png

Offline

 

#5 2010-04-13 19:45:39

Jakey22
Scratcher
Registered: 2008-12-28
Posts: 72

Re: File I/O block

And you guys are saying I'm the copycat. He said the exact same thing I said, but with correct spelling of there! :p


http://www.imagebookers.com/gallery/d/2561-1/ubuntu-wallpaper.png http://bullylug.org/linux-penguin.jpg
My website       PENGUINS!!!!!!!!!!!!!!!!!!!!! randomness.

Offline

 

#6 2010-04-13 19:51:36

SeptimusHeap
Scratcher
Registered: 2010-02-01
Posts: 1000+

Re: File I/O block

OK, fine. But give Panther credit. And lots of it.


http://i46.tinypic.com/dw7zft.png

Offline

 

#7 2010-04-13 19:53:25

Jakey22
Scratcher
Registered: 2008-12-28
Posts: 72

Re: File I/O block

I will!!! Just tell me what method I should use (possibly putting it in the block?).


http://www.imagebookers.com/gallery/d/2561-1/ubuntu-wallpaper.png http://bullylug.org/linux-penguin.jpg
My website       PENGUINS!!!!!!!!!!!!!!!!!!!!! randomness.

Offline

 

#8 2010-04-13 20:57:57

cds56
Scratcher
Registered: 2008-05-02
Posts: 500+

Re: File I/O block

Jakey22 wrote:

And you guys are saying I'm the copycat. He said the exact same thing I said, but with correct spelling of there! :p

I was being a grammar chekkah.

File IO blocks would be kull, and a really good idea.

do you have the code, or do you have the concept(or both??)


http://img192.imageshack.us/img192/909/meowdevlogo.pnghttp://i32.tinypic.com/pucti.png

Offline

 

#9 2010-04-14 07:47:51

SeptimusHeap
Scratcher
Registered: 2010-02-01
Posts: 1000+

Re: File I/O block

WE (Panther, not Jakey) have the code. He wants it.


http://i46.tinypic.com/dw7zft.png

Offline

 

#10 2010-04-17 09:00:02

Jakey22
Scratcher
Registered: 2008-12-28
Posts: 72

Re: File I/O block

bump myself


http://www.imagebookers.com/gallery/d/2561-1/ubuntu-wallpaper.png http://bullylug.org/linux-penguin.jpg
My website       PENGUINS!!!!!!!!!!!!!!!!!!!!! randomness.

Offline

 

#11 2010-04-17 09:08:03

markyparky56
Scratcher
Registered: 2008-03-20
Posts: 1000+

Re: File I/O block

Ok, I can't find all of them, But im not even sure if i should give you them... Ill try find them all before i post them.


http://j.mp/jgVnTq
Check out my game engine development site: NewDawn I'm a Level 171 Scratcher.I am http://bit.ly/nkvLNT

Offline

 

#12 2010-04-19 08:13:16

SeptimusHeap
Scratcher
Registered: 2010-02-01
Posts: 1000+

Re: File I/O block

johnnydean1 wrote:

('contents of file %s' #r #readFile:)
('Write %s to file %s' #- #writeText:toFile:)
('clear file %s' #- #clearFile:)

readFile: t1
    | t2 t3 |
    self askForFileIO = true ifFalse: [^ self].
    (FileDirectory default fileExists: t1)
        ifFalse: [^ ''].
    t2 _ (FileStream readOnlyFileNamed: t1) binary.
    t2 ifNil: [^ ''].
    t3 _ t2 contentsOfEntireFile asString.
    t2 close.
    ^ t3

writeText: aString toFile: aFileNameString
    "Answer the contents of the given file."
   
    | f |
    (self askForFileIO = true) ifFalse: [^ self].
    (FileDirectory default fileExists: aFileNameString) ifFalse: [^ self].
    f _ (FileStream fileNamed: aFileNameString) binary.
    f ifNil: [^ self].
    f setToEnd.
    f nextPutAll: aString.
    f close

clearFile: aFileNameString
    "Clear the given file."
   
    | f dir |
    (self askForFileIO = true) ifFalse: [^ self].
    dir _ FileDirectory forFileName: aFileNameString.
    dir deleteFileNamed: aFileNameString.
    f _ FileStream newFileNamed: aFileNameString.
    f close

You stole this from us, johnny... It's not yours to take or to give out. WE made it.'

And no, johnny, (Not Jake!), you can't use them in your mod...

Last edited by SeptimusHeap (2010-04-19 08:14:45)


http://i46.tinypic.com/dw7zft.png

Offline

 

#13 2010-04-19 09:08:24

nXIII
Community Moderator
Registered: 2009-04-21
Posts: 1000+

Re: File I/O block

johnnydean1 wrote:

('contents of file %s' #r #readFile:)
('Write %s to file %s' #- #writeText:toFile:)
('clear file %s' #- #clearFile:)

readFile: t1
    | t2 t3 |
    self askForFileIO = true ifFalse: [^ self].
    (FileDirectory default fileExists: t1)
        ifFalse: [^ ''].
    t2 _ (FileStream readOnlyFileNamed: t1) binary.
    t2 ifNil: [^ ''].
    t3 _ t2 contentsOfEntireFile asString.
    t2 close.
    ^ t3

writeText: aString toFile: aFileNameString
    "Answer the contents of the given file."
   
    | f |
    (self askForFileIO = true) ifFalse: [^ self].
    (FileDirectory default fileExists: aFileNameString) ifFalse: [^ self].
    f _ (FileStream fileNamed: aFileNameString) binary.
    f ifNil: [^ self].
    f setToEnd.
    f nextPutAll: aString.
    f close

clearFile: aFileNameString
    "Clear the given file."
   
    | f dir |
    (self askForFileIO = true) ifFalse: [^ self].
    dir _ FileDirectory forFileName: aFileNameString.
    dir deleteFileNamed: aFileNameString.
    f _ FileStream newFileNamed: aFileNameString.
    f close

Johnnydean1, please stop. You have stolen my work, given me no credit, and worse, ACTED AS IF IT WAS YOUR WORK.

Oh, and, @Jakey22: these won't work anyway, if you figure out why you can use them  big_smile

Last edited by nXIII (2010-04-19 12:22:23)


nXIII

Offline

 

#14 2010-04-19 10:07:48

nXIII
Community Moderator
Registered: 2009-04-21
Posts: 1000+

Re: File I/O block

johnnydean1 wrote:

Well you disliked me anyway lol

....

lol?!

You can laugh about this? It confuses me. Honestly. Would you care to know WHY I "disliked you anyway"? Because you stole my work, took advantage of the Panther team and Sparks' generosity, then gave us nothing in return, rather, took AWAY from us. I think that's a fair enough reason to dislike you, and I don't think you should be laughing.


nXIII

Offline

 

#15 2010-04-19 10:16:45

johnnydean1
Scratcher
Registered: 2010-02-12
Posts: 1000+

Re: File I/O block

and...


You can now reach me on Twitter @johnnydean1_

Offline

 

#16 2010-04-19 10:18:32

nXIII
Community Moderator
Registered: 2009-04-21
Posts: 1000+

Re: File I/O block

johnnydean1 wrote:

and...

And you should stop acting like you didn't do anything and start apologizing to people.


nXIII

Offline

 

#17 2010-04-19 10:26:58

johnnydean1
Scratcher
Registered: 2010-02-12
Posts: 1000+

Re: File I/O block

Overreaction lol


You can now reach me on Twitter @johnnydean1_

Offline

 

#18 2010-04-19 10:29:52

waveOSBeta
Scratcher
Registered: 2009-12-08
Posts: 1000+

Re: File I/O block

I agree with johnnydean1. NXIII is overreacting. They're only bits of code.


http://internetometer.com/image/10202.png]
New signature coming soon!  smile

Offline

 

#19 2010-04-19 10:36:19

nXIII
Community Moderator
Registered: 2009-04-21
Posts: 1000+

Re: File I/O block

waveOSBeta wrote:

I agree with johnnydean1. NXIII is overreacting. They're only bits of code.

You don't know johnnydean or the whole story. If he had 1.2 (which I made sure he didn't) he wouldn't hesitate to post my entire system of CYOB as his own work

Last edited by nXIII (2010-04-19 12:21:52)


nXIII

Offline

 

#20 2010-04-19 10:37:38

waveOSBeta
Scratcher
Registered: 2009-12-08
Posts: 1000+

Re: File I/O block

You have a point...

So that's why you aren't releasing Panther in beta...


http://internetometer.com/image/10202.png]
New signature coming soon!  smile

Offline

 

#21 2010-04-19 10:38:55

waveOSBeta
Scratcher
Registered: 2009-12-08
Posts: 1000+

Re: File I/O block

O_O

HOW?

Usually, I can get any file. But here i am, stumped, with you having panther?

HUH?


http://internetometer.com/image/10202.png]
New signature coming soon!  smile

Offline

 

#22 2010-04-19 10:41:32

nXIII
Community Moderator
Registered: 2009-04-21
Posts: 1000+

Re: File I/O block

johnnydean1 wrote:

are you sure I dont have 1.2?

Yes. I am. If you have it, prove it to me be saying the number of system windows open in the most recent version. It should be easy. Download the image again and run it.  big_smile  Now we'll know for sure.


nXIII

Offline

 

#23 2010-04-19 10:47:56

nXIII
Community Moderator
Registered: 2009-04-21
Posts: 1000+

Re: File I/O block

johnnydean1 wrote:

What do you mean system windows

The light-green window-like things. Browsers.


nXIII

Offline

 

#24 2010-04-19 10:53:44

nXIII
Community Moderator
Registered: 2009-04-21
Posts: 1000+

Re: File I/O block

johnnydean1 wrote:

2

You know a bit too much for my taste, which is why I changed the password.


nXIII

Offline

 

#25 2010-04-19 10:56:28

nXIII
Community Moderator
Registered: 2009-04-21
Posts: 1000+

Re: File I/O block

johnnydean1 wrote:

Ohh thats why...

That's why what?
Everything you know is at an end. Nothing you can find will work. Only I know the password now, and I will no longer be distributing the image through mediafire.

Last edited by nXIII (2010-04-19 10:57:16)


nXIII

Offline

 

Board footer