Add a script
1. 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.
2. Click on
or select
New Method Template from the
Methods menu. The following template appears in the lower pane:
messagePattern
"comment"
| temporaries |
statements
3. 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 VA Smalltalk's script-writing tools, accessible by clicking on the
,
Subpart Features Syntax tool, icon in the upper left of the Script Editor:
4. 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:
• Visual Programming User Guide
• Programmer Reference
Last modified date: 07/25/2020