Getting Started

This chapter gets you started with Dolphin Smalltalk. The installation program will have created a program folder containing a Dolphin icon. Double-click this to start the Dolphin development system.

Registration

If you intend to use Dolphin seriously, you must register it. Depending on which version you have, one of the following restrictions will exist in an un-registered copy:

Don't worry, though. Providing you have an Internet connection then registration is FREE. Simply go to the Dolphin registration web page at: http://www.object-arts.com/Registration.htm and follow the instructions to immediately receive your password to unlock the system. You will need to provide, amongst other things, a username of your choice and the imagecode that is allocated to you in the "Locked Image" dialog. If you are currently connected to the web, you can go straight to the registration page by clicking Register online now in this dialog.

Since registration is free, I'd recommend that you register your copy right away. If you have one of the Dolphin versions that is not initially disabled then you can still choose to register it early by using the Tools/Options/Register now menu command. This will bring up the "Locked Image" dialog and you can then follow the instructions above to register.

Obtaining Support

There may be times when you run across a problem with Dolphin that you can't solve yourself. If so, you can obtain technical support from Object Arts Ltd. by Internet email or by connecting to the special Dolphin newsgroup forum. For more details, please visit the Object Arts Support web page at: http://www.object-arts.com/Support.htm.

First Use

When you start Dolphin for the first time, and after you have dealt with the License Agreement and any necessary registration, you will be presented with two windows: a System Transcript window and a Workspace window.

The workspace contains a welcome message and some interesting experiments that you can try immediately to get an insight into the interactive nature of the Smalltalk development environment. These experiments consist of executing small pieces of Smalltalk code and displaying the results.

Note that the green pieces of text enclosed in quotes are simply comments and not part of the examples themselves. Most of the examples fit on a single line. To execute one (say the first, 3+4) simply place the text cursor anywhere on that line and type Ctrl+D. You'll see the result printed and highlighted at the end of the line. You can then delete the result simply by pressing the Del key and the highlighted text will disappear.

In some cases, the comment above the example will suggest that you just execute the code without actually displaying a result. You do this by typing Ctrl+E (for Evaluate It) rather than Ctrl+D (for Display It). These commands can also be chosen from the Workspace menu. Simply choose Workspace/Display It or Workspace/Evaluate It as required.

For those examples that span several lines you must select and highlight all of the lines before typing Ctrl+D or Ctrl+E.

If you are new to Smalltalk, then I don't really expect you to understand how these examples work yet. They are simply there for a bit of amusement and to get you used to using a workspace window. You can close the workspace at anytime and continue with the remainder of this chapter.

Opening a new Workspace

If you have not already done so, close the example workspace window that you've been using up to now. You should then be left just with the Transcript open.

As we've seen, a workspace is a general text window where snippets of Smalltalk code can be edited and executed (in Smalltalk parlance, evaluated). It is one of a number of development tools that Dolphin provides. For the next few chapters we will be using workspaces, almost exclusively, to interact with the system and perform our experiments.

At the start of each chapter you'll be asked to open a new workspace in which the work for that chapter will be performed. You can do this by choosing the File/New menu command from the Transcript or from any other workspace or Dolphin development tool window. You may also use the New toolbar button or the Ctrl+N shortcut if you prefer.

At the end of each chapter you should probably tidy up by closing the workspace (and any other example windows) that you have been using. This will free up any memory space and leave the system ready for continuing with the subsequent chapters.

Exiting Dolphin

You can leave Dolphin at any time by choosing File/Exit Dolphin in any of the development tools. Alternatively, you can also ask to quit by closing the Transcript window. As you do so, you will be prompted and asked if you wish to save the image. Under normal circumstances you will opt to do so, since this will save the state of your environment such that it will be fully restored next time you start Dolphin up.

Try exiting and re-starting Dolphin now, saving the image in the process. If you see a "Locked Image" dialog when trying to save the image this is an indication that you need to register your copy of Dolphin. If you don't do so, you will have to exit without saving the image.

The Image

When Dolphin is loaded and running there are many objects in memory that make up the essence of the entire system. I will talk more about what objects are in the next chapter on Objects and Messages. However, for the moment, it is important to know that when you choose to save the Dolphin image you are requesting that all these objects be saved to disk in, what is known as, an image file. This allows the system to be re-started in an identical state to that when the image was saved.

When should I save my Image?

The image contains not only those objects that you may create yourself but also very many objects that are concerned with the Dolphin development system itself. This is a really flexible system since virtually everything is exposed to you and you can make changes that affect not only the program you may be building but also any of the development tools themselves. This can allow you to tailor the system in ways that are not possible with traditional development environments.

However, this flexibility also brings with it certain dangers. You may, by accident, make a change that corrupts your image such that the development tools no longer work. For this reason, it is always important that you have a good saved image to go back to. I'd recommend that you save your image, not only when you exit Dolphin, but also quite often during use. I suggest you do this at least every hour and once at the end of each chapter in this guide. Do take care, though, not to save down an image that you might have corrupted in any way.

Let's try a simple example to prove the point. Open up a new workspace window and arrange it appropriately on the screen. Now save the image using File/Save Image or the Save Image toolbar button (the one with the camera). This will save your current state to an image file on disk. Now let's do some irreparable damage and recover from it. Enter the following line of code into your workspace and evaluate it with Ctrl+E:

Processor := nil.

 You'll see that the development system will crash. This is not surprising really when you consider that you have just instructed the main processing element to disappear. However, now restart Dolphin and you should get back to the same state you were in when you previously saved the image.

Backups

Ideally, you should also take backups of your Dolphin image files. If you do so, you must always save the following three files together:

You'll find these files in the directory where you chose to install Dolphin itself. If you need to restore a backup (perhaps because you accidentally do save down a corrupt image at some point) then you must make sure that you restore all three files together. These files are inextricably linked and should not be separated.

I tend to take a backup of my Dolphin image files daily.

The Transcript

The System Transcript window has been lurking in the background during all of this and we haven't paid much attention to it. In many ways it is similar to a standard workspace window, except of course that when you try to close it Dolphin will exit.

You can use it to evaluate pieces of Smalltalk code just like you been doing in workspaces, however, this is not its main purpose. It is used as an easily visible location where information can be logged and brought to your attention. The development system may choose to write things to the Transcript or you may do so yourself. Try this by evaluating it in a workspace (with Ctrl+E):

Transcript cr; show: 'Hello world'; cr.

You should see that this welcome text has now been logged to the Transcript window.

What have you learned?

The aim of this chapter was to get you started with Dolphin. By now, you should be familiar with:


 Click here to move on to the next chapter or here to go back to the previous chapter.