IForeMethodParam.DefaultValue

Syntax

DefaultValue: Variant;

Description

The DefaultValue property sets default parameter value.

Example

Executing the example requires that the repository contains an area of the global parameters with the SHARED_P identifier.

Sub Main;

Var

mb: IMetabase;

Shp: ISharedParams;

UserMeth: IForeMethods;

uMethod: IForeMethod;

MethParams: IForeMethodParams;

mParam: IForeMethodParam;

Begin

mb := MetabaseClass.Active;

Shp := mb.ItemById("SHARED_P").Bind As ISharedParams;

UserMeth := Shp.Methods;

uMethod := UserMeth.FindByKey(1);

If uMethod <> Null Then

uMethod.Bind;

MethParams := uMethod.Params;

mParam := MethParams.FindByParam("PARAM_1");

If mParam <> Null

Then Debug.WriteLine(mParam.DefaultValue);

Else Debug.WriteLine("Parameter is not found");

End If;

End If;

End Sub Main;

After executing the example the search of the PARAM_1 parameter at the custom method with the key 1 is executed. If the parameter is not found, its default value is displayed in the console window.

See also:

IForeMethodParam