Skip to end of metadata
Go to start of metadata

The instruction creates a new property.

Syntax

name [caption] [(param1, ..., paramN)] = expression [options];
name [caption] [(param1, ..., paramN)] = contextIndependentOperator [options];

Description

The  instruction declares a new property and adds it to the current module.

When creating a property, the instruction has two forms:

When declaring a property, its set of options can also be specified.   

Parameters

name 

The name of the property. Simple ID.

caption

Property caption. String literal. If no caption is specified, then the property caption will be its name.  

param1, ..., paramN

List of parameters. Each of these is specified by a typed parameter. These parameters can then be used in the expression describing the property being created (as well as in some options).

If parameters are not specified explicitly, they will be automatically calculated when processing the expression. The order of the parameters will correspond to the order in which the parameters appear in the expression. It is recommended that you explicitly specify property parameters. This will allow to find typos and other errors in the declaration (for example, a mismatch of the number of parameters provided with the number of parameters of the created property).

expression

An expression that describes and creates a property. 

contextIndependentOperator

A context-independent property operator that describes and creates a property. 

options

Property options

Examples

1
2
3
4
5
 cost 'Cost' (i) = DATA NUMERIC[12,3] (Item);		// property defined by the context-independent DATA property operator
weightedSum 'Weighted amount' (a, b) = 2*a + 3*b; 		// property defined by expression 
diff = a - b; 											// the caption of this property will be 'diff' and the parameters will be (a, b)
 
teamName 'Team name' = DATA BPSTRING[30](Team) IN baseGroup TABLE team; // property defined by DATA operator with additional property options