Chun's Smalltalk Environment Setup Tutorial

 

    By now you should all know that this is an environment tutorial.   For language tutorial, please go back to 341.

 

Getting Smalltalk

It is recommended to use Smalltalk in room 232 (NT lab#1) because the settings in room 329 (NT lab#2) may be different.  Please do not use 'Smalltalk/express' under the start menu.  You will need to get a copy of Smalltalk/Express from the network drive "courses on 'ifilesrv1'(U:)" and put it in your home directory.  To do so, first go to your own directory:

        Z:\chunyu

Create a folder called Smalltalk:

        Right Click -> new -> folder

Now go to the network drive "courses on 'ifilesrv1'(U:)", then go into

        U:\cse341\Software (it may be some other drive rather than U:)

 

(Note:  if you don't see the network drive "courses on 'ifilesrv1'(U:)", you need to map to the U drive.  To do so, highlight the 'My Computer' icon on your desk top, do

        Right Click -> Map Network Drive

Find U: where it says "Drive:", and in "Shared Directories:", double click "IFILESRV1", then click courses and click ok.  Now you U drive will have the network drive "courses on 'ifilesrv1'(U:)")

You will see a folder called "st-img".  Now highlight the "st-img" folder, then do

        Right Click -> copy

Then go into the Smalltalk folder you have just created in your home directory:   Z:\chunyu\Smalltalk, and do

        Right Click -> paste

You should now have a folder called "st-img" in your home directory.

 

Starting Smalltalk

Now go into the "st-img" folder that you have just made   (Z:\chunyu\Smalltalk\st-img).  You should see a file called "Vw.exe".  Double click that to start Smalltalk/Express.  If you cannot start that because an error occurs (such as missing a DLL file), it may be that the path variable is not pointing at the necessary place.  To check that, click

        Start -> Settings -> Control Panel

and double click Systems.  Then go to the Environment tab, in the "System Variables" window, find the variable Path (it may appear in the "User Variables for .." window).  Check to see if you have the value called c:\stexpres (or c:\app\stexpres, either one is fine).  You may need to stretch it to see all your values, since it is not long enough to show all the values.  If you don't have one of those two values, you need to add it then.  That's why it is recommended to work in room 232, since not all the machines in 329 has those folders.

Using Smalltalk/Express from home

You can download a copy of Smalltalk/Express here: newste.zip (about 3 MB big!). This is a pkzip archive that you can install at home using (get pkunzip.exe if you don't already have it):

Then you can execute "Vw.exe" directly from that directory. Remember to change your "path" environment variable if you will be running "Vw.exe" from directories other than the directory in which you uncompressed the STEXPRES.ZIP file. Should you ever want (or need!) a fresh image, you can get it here: V.EXE (about 1.3MB).

See also Smalltalk Express Product Information and documentation

 

Smalltalk Example

A window called "Smalltalk Express Transcript" will show up after you have executed "Vw.exe".  We will need to open another window to write our code, so click

        File -> New Workspace

and a window called "Smalltalk Express Workspace" will show up.  You can try typing in

        1 + 2.

then click

        Smalltalk -> Show It of Current Line (or Ctrl-J for short)

to execute that line, and you will get a highlighted 3 as your result.

Let's do a more interesting example.  Now type in

        Window turtleWindow: 'foo'. (Ctrl-J)

A new window called "Smalltalk Express foo" will show up.  Now set all your windows so that nothing is covering the "Smalltalk Express foo" window.   Type in

        Turtle go: 50. (Ctrl-J)

        Turtle turn: 90. (Ctrl-J)

        Turtle go: 50 (Ctrl-J)

        Turtle turn: 90. (Ctrl-J)

        Turtle go: 50 (Ctrl-J)

You can see on the "Smalltalk Express foo" window that we are drawing on that window.  For more info about the language syntax, go back to 341.

You can also play around with the useful "Classes hierarchy and its methods" by clicking

        File ->Browse Classes

on your "Smalltalk Express Workspace" window.  Another window called "Smalltalk Express Enhanced Class Hierarchy Browser" will show up, and you can click on the classes to see what methods each classes have, and how they are used, etc.

Note that if you want to save your code, do not use filenames that has more than 8 characters (excluding the .st extension).  It is because this environment is written to the Win16 API and breaks on longer filenames.  Also, when you quit Smalltalk/Express, do not save the image unless you want that image.  Otherwise, you may need to get a fresh image.

 

Thanks Greg for helping me setting up this tutorial.  It will a lot more work without his help!

 

Back to 341