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

#1 2011-05-04 14:57:11

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

running smalltalk from an external source

Specifically I need this for the block library. Is there a way to give a block a piece of smalltalk like

Code:

|t1|
t1_ self readLine: '1' FromURL: 'online smalltalk code.txt'.

and then run the contents of t1 as if the code was actually in the block?

This would allow us to update this one file to automatically update the coding of this block for every single person without them having to edit their existing block in any way.


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

Offline

 

#2 2011-05-04 15:01:06

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

Re: running smalltalk from an external source

Yes there is. I will get the code.

Here is what I use in Claw.

runSmallt: t1
    Compiler
        evaluate: t1
        for: self
        logged: false


You can now reach me on Twitter @johnnydean1_

Offline

 

#3 2011-05-04 15:15:18

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

Re: running smalltalk from an external source

that's not quite working in a Panther custom block...


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

Offline

 

#4 2011-05-04 15:26:50

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

Re: running smalltalk from an external source

Download claw and try it for yourself.


You can now reach me on Twitter @johnnydean1_

Offline

 

#5 2011-05-04 15:29:27

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

Re: running smalltalk from an external source

It does:

Name: run smalltalk $String$
Code:

Compiler
        evaluate: t1
        for: self
        logged: false

Note: Using ' (quotes) does NOT work.


You can now reach me on Twitter @johnnydean1_

Offline

 

#6 2011-05-04 15:41:36

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

Re: running smalltalk from an external source

johnnydean1 wrote:

It does:

Name: run smalltalk $String$
Code:

Compiler
        evaluate: t1
        for: self
        logged: false

Note: Using ' (quotes) does NOT work.

so the smalltalk is not allowed any quotes in it? Does that not basically rule out any block that sets variables to strings?


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

Offline

 

#7 2011-05-04 15:45:26

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

Re: running smalltalk from an external source

I just run into an error - nothing expected after t1 is set whenever I try to run the block...


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

Offline

 

#8 2011-05-04 15:52:06

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

Re: running smalltalk from an external source

set the input to: 'self nextCostume'


You can now reach me on Twitter @johnnydean1_

Offline

 

#9 2011-05-04 16:22:15

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

Re: running smalltalk from an external source

http://dl.dropbox.com/u/22935223/error.PNG


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

Offline

 

#10 2011-05-04 16:51:13

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

Re: running smalltalk from an external source

You coded the block wrong.
as I said above:
        Compiler
        evaluate: t1
        for: self
        logged: false
YOU MISSED OUT COMPILER!


You can now reach me on Twitter @johnnydean1_

Offline

 

#11 2011-05-04 17:04:48

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

Re: running smalltalk from an external source

oops.

Sadly this isn't going to work for the Panther download block because it contains speech marks  sad


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

Offline

 

#12 2011-05-04 17:06:10

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

Re: running smalltalk from an external source

sparks wrote:

oops.

Sadly this isn't going to work for the Panther download block because it contains speech marks  sad

I don't think there is anyway around that. Ask LS97 he may know. (I believe the block is also in Bingo)


You can now reach me on Twitter @johnnydean1_

Offline

 

#13 2011-05-04 17:57:01

Pecola1
Scratcher
Registered: 2010-09-06
Posts: 1000+

Re: running smalltalk from an external source

I gave you a code on the block library post.


If you are reading this, please read to the end, because if you don't you won't know what's at the end. Don't just skip to the end though otherwise you won't be able to read the middle, which is most important. Now you must be wondering why you just read all that, the reason is you may have not noticed something, read it again and see if you notice it this time  smile

Offline

 

#14 2011-05-04 17:58:02

Pecola1
Scratcher
Registered: 2010-09-06
Posts: 1000+

Re: running smalltalk from an external source

Lemme try.


If you are reading this, please read to the end, because if you don't you won't know what's at the end. Don't just skip to the end though otherwise you won't be able to read the middle, which is most important. Now you must be wondering why you just read all that, the reason is you may have not noticed something, read it again and see if you notice it this time  smile

Offline

 

Board footer