Adding scripts
In this section you learn about writing scripts for VA Smalltalk. If you follow the steps to add a script you will have a file browser that looks like the following:
Scripts are useful when you need to add unique actions to a part or when there is no visual connection that does precisely what you need. Scripts are most appropriate for creating application logic. You can build your user interface using scripts, although it is usually easier to build it using the Composition Editor and visual connections.
Some common uses for scripts include:
•Conditional logic, such as displaying one of several views depending on the type of document
•Special validation or formatting that goes beyond built-in conversion and editing, for example, formatting the results of a database query before placing the results in a list box
•Signaling special events, such as when a database query returns a specific result
For simple uses like these, you can link scripts to events or attributes in the Composition Editor. Before you can write scripts, you need to learn the fundamentals of Smalltalk, the language that is used to write scripts. Smalltalk is easy to learn because of its simple syntax and structure.
Scripts are also used for implementing the actions of new parts, particularly for parts that perform your application-specific logic. When you advance to this level of VA Smalltalk programming, you will also want to learn more about the overall Smalltalk system and its class library, which are described in Programmer Reference.
Last modified date: 07/23/2020