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

Mitchell, David [CC] David.Mitchell at mail.sprint.com
Tue Mar 23 09:25:12 PST 2004


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...).

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.

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



-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://squeakland.org/pipermail/squeakland/attachments/20040323/99078760/attachment.htm


More information about the Squeakland mailing list