Using InterSystems Development Environments — Atelier and Studio
Adding Class Parameters to a Class
[Back] [Next]
Go to:

A class parameter defines a constant value for all objects of a given class. When you create a class definition (or at any point before compilation), you can set the values for its class parameters. By default, the value of each parameter is the null string; to set a parameter's value, you must explicitly provide a value for it. At compile-time, the value of the parameter is established for all instances of a class. This value cannot be altered at runtime.

You can add a class parameter to a class definition in two ways:
To add a method using the Class Editor, position the cursor on a blank line in the Class Editor and enter a class parameter:
Parameter P1 = "x";
New Class Parameter Wizard
You can use the New Class Parameter Wizard to create a new class parameter. You can open the New Class Parameter wizard using the Class > Add > Class Parameter . Alternatively, right-click the Class Inspector and select Add New Class Parameter or select the New Class Parameter icon on the toolbar.
The New Class Parameter wizard prompts you for information. Select Finish at any time (default values are provided for any information you have not specified).
See for more information about class parameters see the chapter Caché Classes in Using Caché Objects.
The New Class Parameter wizard prompts you for the following information (you can later modify any of these values):
(required) Name of the class parameter. This name must be a valid parameter name and must not conflict with the name of a previously defined parameter.
For a general discussion on names see the chapter Caché Classes in Using Caché Objects.
(optional) Description of the new class parameter. This description is used when the class' documentation is displayed in the online class library documentation.
A description may include HTML formatting tags. For more details see the section Using HTML in Descriptions in the “Class Definition Syntax” appendix.
Default value for the class parameter. This will be the default value for this parameter for all instances of this class.