Classifying scripts
In addition to specifying a custom
category, you can classify scripts as
public or
private, or as
class methods or
instance methods.
Public and private
By convention, scripts marked public can be used freely by other scripts in other classes. Scripts marked private should only be used by scripts in the same class because they are subject to change. This is only a convention and not a rule that is enforced.
To see which scripts are public or private, select the tab with that label.
Note
Without VA Assist loaded, public or private scripts are indicated by a tollgle button. To see which scripts are public or private, use the public/private push button. This push button is a toggle. When you select it, the label changes to private. When you select it again, the label changes back to public. When the label is public, only public scripts are shown in the list. When the label is private, only private scripts are shown in the list.
When you save a script, it is marked either public or private, depending on the current label of label.
After a script is created, you can change its classification by selecting the script and selecting Change Public/Private from the Methods menu.
Class and instance
The scripts that you write for script connections are called instance methods, because every instance of your visual part understands the messages that these methods implement.
The class that defines the visual part can also have scripts, which are called class methods, because only the class definition itself can understand the message that calls these methods.
Use the instance push button to toggle between creating instance and class methods. When you save a script, it is marked either instance or class, depending on the current label of the push button. When the label is instance, only instance methods are shown in the list. When the label is class, only class methods are shown in the list.
Most of the methods you create as a new user are instance methods. Class methods become important when you begin creating reusable parts.
Comments and notes
When you select the method comments tab in the center of the Script Editor, the text area shows the comments for the script. Comments provide information useful for users of a class. When you select the method notes tab, the label of the button changes to notes, and the text area shows any notes for the script. Notes provide information that the maker of the class doesn't want to forget. Select the the method source tab and the text area shows the source for your script again.
Last modified date: 07/01/2020