You are here: Symbol Reference > Dew Namespace > Dew.Math Namespace > Classes > TMtxExpression Class > TMtxExpression Properties > TMtxExpression.VarByName Property
Dew Math for .NET
ContentsIndexHome
PreviousUpNext
TMtxExpression.VarByName Property

Returns variable by name or nil, if variable does not exist.

Syntax
C#
Visual Basic
public TVarByNameIndexer VarByName;

Use parser to evaluate the "(2*i*z)" formula where z=-2+3*i.

using Dew.Math; using Dew.Math.Units; namespace Dew.Examples() { void Example() { // 1. Add formula and evaluate, MyParser.AddExpr("2*i*z"); // 2. Get defined variable z = MyParser.VarByName["z"]; // 3. Specify the type z.DefineComplex(); // 4. Set values z.ComplexValue = Math387.Cplx(-2,3); // 5. Evaluate TCplx res = MyParser.EvaluateComplex(); // res = -6-4*i } }
Copyright (c) 1999-2024 by Dew Research. All rights reserved.
What do you think about this topic? Send feedback!