DefaultValue: Variant;
The DefaultValue property determines a value for the parameter by default.
This value will be put in the editor and used when the object is opened from the navigator of objects. If the value by default is set for all parameters, the dialog of input of parameters values is not displayed when the object is opened from the object navigator.
Executing the example requires that the repository contains an object with the OBJTEST identifier.
Sub Main;
Var
MB: IMetabase;
MObj: IMetabaseObject;
Params: IMetabaseObjectParams;
Param: IMetabaseObjectParam;
Begin
MB := MetabaseClass.Active;
MObj := MB.ItemById("OBJTEST").Edit;
Params := MObj.Params;
Param := Params.Add;
Param.DataType := DbDataType.Integer;
Param.Name := "Coefficient value";
Param.DefaultValue := 100;
MObj.Save;
End Sub Main;
A new parameter is created for the specified object after executing this example. Integer numbers are specified as values for current parameter. Default value is 100.
See also: