VisualAge for Smalltalk VisualAge-related FAQs

The following Frequently Asked Questions (FAQ) focus on VisualAge for Smalltalk in general:

How do I change the starting text for a new method?
Look in the Smalltalk Preferences Workspace.
Transcript -> Smalltalk Tools -> Open Preferences Workspace.
You will find the line:
EtTools publicTemplate: 'messagePattern\ "comment"\ | temporaries |\statements' addLineDelimiters
Make changes and execute the line to put them into effect.
What references are there for being productive in VisualAge?
To start with, you need to make sure you understand the underlying concepts and language.
For basic OO concepts, you should use:
"Object-Oriented Technology: A Manager's Guide" by David Taylor (Xxxxxx, 19xx) ISBN nnnnnnnnnn A very good, short introduction to OO in book form.
"Navigating Objects: The interactive approach to object technology" by Hatteras Software (SIGS Books, 1996) ISBN 1-884842-32-1
A very good interactive course on CD to teach you OO concepts.

For Smalltalk, you should use:
"IBM Smalltalk, The Language" by David N. Smith (Benjamin-Cummings, Redwood City, CA) ISBN 0-8053-0908-X
An in-depth look at the language.
"IBM Smalltalk, Programming for Windows and OS/2" by Dan Shafer and Scott Herndon (Prima Publishing, Rocklin, CA) ISBN 1-5595-8749-0
A learn through examples book.

Then you are ready to get into VisualAge.
For VisualAge, you should use:
"Presenting VisualAge for Smalltalk" (IBM, SR23-7384-00)
A short demonstration CD.
"Xxxxxxxxxxxxxxxxx" by Chamond Lui (Xxxxxxxxxx, 19xx) ISBN nnnnnnnnnn
A good xxxxxxxxxx
"Xxxxxxxxxxxxxxxx" by Andi Bitterer (Xxxxxxxxxx, 19xx) ISBN nnnnnnnnnnnnn
A comprehensive book of tips.
How do I override the action that occurs when the system menu "Close" is selected?
You need to hook into the closeWidgetRequested event. The method that you write which will get invoked by the event will be passed a parameter (frequently referred to as aDoit). The aDoit object implements a method called doit: which must be passed a Boolean. If you pass it a true then the window will close. If it is passed a false then the window stays open. Below is some sample code.
systemMenuClose: aDoit
| aBoolean |

aBoolean :=(self subpartNamed: 'Exit Message Prompter') prompt.
(aBoolean)
   ifTrue: [
      OrderConfirmationReportHandler terminate.
      self class clearUniqueInstance.
      aDoit doit: true.
    ]
   ifFalse: [aDoit doit: false.].
Is there a way to change the working directory of a ProgramStarter?
The directory you want the program to start in is based on the default path of the Visualage program. Hence if you want the program to start in a different directory, you must change the directory and path. The path information is stored within the Common File System objects. The following commands returns the startup directory of your current environment or your "cwd" current working directory. Hence your program runs in the "cwd".
    CfsDirectoryDescriptor startUpDirectory.
    CfsDirectoryDescriptor getcwd.
To change the default directory where the AbtProgramStarter runs, execute the following method to whatever directory you need. For example, let's say you wanted to run in the directory C:\WINDOWS. Then you would execute the following:
    CfsDirectoryDescriptor chdir: 'C:\WINDOWS'.
I would recommend that you restore the "cwd" back to its original state, once you have started the program via:
    origDir := CfsDirectoryDescriptor getcwd.
    ...
    ... Change the dir
    ... Start your program
    ...
    CfsDirectoryDescriptor chdir: origDir.   "Restore original dir"
Is there a way to get the attributesPage to show in its entirety in the composition editor?
Open the composition editor on the settings page. From its pop-up menu select View Parts List. Double-click on primary part. On the Layout settings page change the width and height to some positive value (I like 20). Click OK. You will now see the form in the window which you can resize to an appropriate size. Before saving the part, set the width and height you modified above back to 0.
Is there a simple way to convert from string to date?
Extend class string with method: asDate as follows:
asDate

  ^ AbtDateConverter new
          showForDigitYear: true;
          becomeDMY;
          primDisplayToObject: self ifError: [:e | e]
This is for german month format. For US-date format you have to use 'becomeMDY' instead of 'becomeDMY'. If conversion could not be made return value will be an AbtError.
Why do I get a "Circular constraint detected" upon opening a widget?
This is telling you that you have a problem with some of the attachments on this window. This indicates that something about an edge in A is defined in terms of an edge of B which is itself defined in terms (perhaps indirectly) of an edge in A, etc. etc.
How can I read an OS environment variable from VAST?
Try EsString>>abtScanEnv, e.g. 'PATH' abtScanEnv

Home Page

Copyright 1997 Hatteras Software. Some portions copyright IBM.