Skip to main content

Adding Class Parameters to a Class

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:

  • Adding a class parameter to the class definition using the Class Editor.

  • Using the New Class Parameter wizard.

To add a parameter using the Class Editor, position the cursor on a blank line in the Class Editor and enter a class parameter such as:

Parameter P1 = "x";

For details on parameter definitions, see Defining and Referring to Class Parameters. Also see Parameter Definitions in the Class Definition Reference.

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 by selecting Class > Add > Class Parameter . Alternatively, right-click the Class Inspector and select Add > New Class Parameter. You can also click the New Class Parameter button pink cube with a yellow starburst 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).

The New Class Parameter wizard prompts you for the following information (you can later modify any of these values):

Name

(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.

See Rules and Guidelines for Identifiers.

Description

(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. See Creating Class Documentation in Defining and Using Classes.

Default

Default value for the class parameter. This will be the default value for this parameter for all instances of this class.

FeedbackOpens in a new tab