How Do I...
To add a script in the Script Editor:
- Select a category (upper-left pane).
Or, if a category doesn't exist, select Add from the
Categories menu. In the displayed prompter, type the name of
the category and select OK.
- Click on
or select New Method Template from the Methods
menu. The following template appears in the lower pane:
messagePattern
"comment"
| temporaries |
statements
- Replace items in the template as follows:
- messagePattern
- A name for the script. When you connect the script to a visual
part, you'll use this name. The name should begin with a lowercase
letter.
- "comment"
- A description of the script. A comment is optional. If you
include one, be sure to enclose it in double-quote marks.
- | temporaries |
- Any temporary variables you want to use within the script, enclosed in
vertical bars (| |). The variables are not preserved after
the script runs.
- statements
- The Smalltalk code for your script. Writing the code is the hardest
part of making a script. To make it easier, use VisualAge's
script-writing tools, accessible by clicking on
, Subpart Features Syntax tool, icon in the upper left
of the Script Editor:
- From the File menu, select Save Script. Or,
click mouse button 2 on the lower pane, and select Save from the
pop-up menu. (On UNIX, use mouse button 3.)
If your code has syntax errors, a highlighted message appears. If
there are no errors, the name of your script appears in the upper-right
pane.
For extensive information on writing scripts, see:
[ Top of Page | Previous Page | Next Page | Table of Contents ]