[Newbies] Some general questions

Norbert Hartl norbert at hartl.name
Wed May 23 08:59:33 UTC 2007


On Tue, 2007-05-22 at 15:58 +0100, Darren White wrote:
> Hello
> 
> Is there a way to use a string as the name for a object? For example
> if I have the input string 'fred' from a user input field how do I
> create a object named userFred or even just fred?
> 
You can get the class object from a String by using

Smalltalk classNamed: #fred

On this class you can invoke new to get an object.

> What is the difference between the source file and the image? Does the
> image use the code from the source file? If I create code dose it live
> in the image or source file? 
> 
There are three files: sources, changes, image. The sources file
never changes if you are working with the image. The changes file
records all source code you enter/alter. The image contains all the
compiled source code and the objects which have been created from
there. The image is the actual state of your environment which have
been dumped to disk.

> Is there a way to trigger a save prompt when clicking on the window
> close button?
> 
I don't know. Usually it is the other way round. You will be asked
to close the window discarding unsaved changes.

Norbert



More information about the Beginners mailing list