INonLDVariables.Clear

Syntax

Clear;

Description

The Clear method removes all variables from the collection.

Comments

To remove variable from the collection by its index, use the INonLDVariables.Remove method.

Example

Add a link to the Cp system assembly.

Sub UserProc;
Var
    Optima: NonLinearDecomposition;
    Vars: INonLDVariables;
    Vrbl: INonLDVariable;
Begin
    Optima := New NonLinearDecomposition.Create;
    Vars := Optima.Variables;
    Vrbl := Vars.Add("x1");
    Vrbl := Vars.Add("x2");
    Vars.Clear;
    Debug.Writeline("Variables in collection: " + Vars.Count);
End Sub UserProc;

After executing the example all variables are removed from the collection. The console window displays collection size.

See also:

INonLDVariables