[Squeakland] getting code from a .txt file into a script

Gary Frederick gary.frederick at jsoft.com
Tue Mar 23 10:34:50 PST 2004


Howdy,

Mitchell, David [CC] wrote:
> 
> The Squeakland image hides the File List (or it seems that way to me). 
> So, I have to do a little trick to reveal it:
> 
> Middle-click on the desktop to show the halos.
> Click the menu halo (red) to show the world menu.
> Click "desktop menu..." to show (another, different) world menu.
> Click "open..." to show the open... menu.
> Click "file list" to open the file list.
> Use the tree to navigate to the directory containing the .txt file.
> Select the file in the top-right pane.
> In the lower pane, select the code (probably all of it).
> Right-click and choose "do it" (or press Alt+d or Command+d or...).

Thanks!

> 
> All text in squeak is do-able. When I give Squeak presentations, I often 
> select my presentation text and do-it (even TrueType text, which doesn't 
> have "do it" on its menu supports alt+d). Also, you can browse Smalltalk 
> web sites in Scamper and evaluate expressions right out of the browser pane.

This will do it. And it's agreat suggestion I will follow up with.

Now all I have to do is find out how to "do it". ;-) When I tried it, 
Squeak told me it did not understand what I wanted it to do.

This is an etoy. How do I point at the car object?

I had
   self forward: 100
I did it and it did not know what self was (I think)

I then tried putting in the car
   Car forward: 100
and it did not know how to #forward

How do I reference an object in an etoy?

Sorry for the basic questions. I have no time to look today and want to 
show the kids tomorrow.

Thanks,

Gary

> 
> You could also write a script to read the file and then evaluate its 
> contents.
> 
> -----Original Message-----
> From:   squeakland-bounces at squeakland.org on behalf of Gary Frederick
> Sent:   Tue 3/23/2004 6:13 AM
> To:     squeakland at squeakland.org
> Cc:    
> Subject:        [Squeakland] getting code from a .txt file into a script
> Howdy,
> 
> I am about ready to show the kids Squeak tomorrow. One thing I would
> like to know how to do is how to read a .txt file that has code into a
> project (is that how to 'say' what I want to do?)
> 
> I will have some examples I will want the kids to have as scripts. Say I
> have a text file that has this in it.
> 
> box
>    self forward: 100.
>    self turn: 90.
>    self forward: 100.
>    self turn: 90.
>    self forward: 100.
>    self turn: 90.
>    self forward: 100.
>    self turn: 90
> 
> I want to be able to read it into a script in a project like the script
> project in the Worlds of Squeak.
> 
> This is a class of kids that are playing with robots. They have been
> working with programming LEGO robots and with a simulator. I am
> interested in taking their programs and translating them into a script
> they can use in Squeak... if I can get the .txt files into scripts.
> 
> I'll put some scripts into an image and let them each have a copy of the
> image if I don't find out how to go from a .txt file to a script. That
> solution is better than nothing and I can do it by tomorrow :-)
> 
> Gary
> 
> _______________________________________________
> Squeakland mailing list
> Squeakland at squeakland.org
> http://squeakland.org/mailman/listinfo/squeakland
> 
> 


More information about the Squeakland mailing list