GetuCalcMethod

Applies to:Fast Math Parser
Class:uCalc.Item
Returns the uCalc object that the uCalc.Item belongs to
Syntax
GetuCalc()
Remarks
A uCalc.Item is defined in the context of a uCalc object. You can later use this function to determine the uCalc object the defined item belongs to.
Example 1: Doing an Eval in the same uCalc instance a variable belongs to

Dim uc1 As New uCalc
Dim uc2 As New uCalc

Dim x1 = uc1.DefineVariable("x = 5")
Dim x2 = uc2.DefineVariable("x = 6")

Console.WriteLine(x1.GetuCalc().Eval("x*10")) ' Returns 50: ' Same as uc1.Eval("x*10");
Console.WriteLine(x2.GetuCalc().Eval("x*10")) ' Returns 60: ' Same as uc2.Eval("x*10");

uc1.Release(): ' Since x1 is part of uc1, x1 is automatically released as well
uc2.Release(): ' Since x2 is part of uc2, x2 is automatically released as well

          

uCalc uc1 = New uCalc();
uCalc uc2 = New uCalc();

var x1 = uc1.DefineVariable("x = 5");
var x2 = uc2.DefineVariable("x = 6");

Console.WriteLine(x1.GetuCalc().Eval("x*10")); // Returns 50; // Same as uc1.Eval("x*10");
Console.WriteLine(x2.GetuCalc().Eval("x*10")); // Returns 60; // Same as uc2.Eval("x*10");

uc1.Release();  // Since x1 is part of uc1, x1 is automatically released as well
uc2.Release();  // Since x2 is part of uc2, x2 is automatically released as well

          

//uc1 uCalc.Create;;
//uc2 uCalc.Create;;

//var x1 = uc1.DefineVariable('x = 5');
//var x2 = uc2.DefineVariable('x = 6');

      WriteLn(x1.GetuCalc().Eval('x*10')); // Returns 50; // Same as uc1.Eval('x*10');
      WriteLn(x2.GetuCalc().Eval('x*10')); // Returns 60; // Same as uc2.Eval('x*10');

      uc1.Release();  // Since x1 is part of uc1, x1 is automatically released as well
      uc2.Release();  // Since x2 is part of uc2, x2 is automatically released as well

          

uCalc uc1;
uCalc uc2;

auto x1 = uc1.DefineVariable("x = 5");
auto x2 = uc2.DefineVariable("x = 6");

cout << x1.GetuCalc().Eval("x*10") << endl; // Returns 50; // Same as uc1.Eval("x*10");
cout << x2.GetuCalc().Eval("x*10") << endl; // Returns 60; // Same as uc2.Eval("x*10");

uc1.Release();  // Since x1 is part of uc1, x1 is automatically released as well
uc2.Release();  // Since x2 is part of uc2, x2 is automatically released as well

          

uCalc uc1;
uCalc uc2;

auto x1 = uc1.DefineVariable("x = 5");
auto x2 = uc2.DefineVariable("x = 6");

Console::WriteLine(x1.GetuCalc().Eval("x*10")); // Returns 50; // Same as uc1.Eval("x*10");
Console::WriteLine(x2.GetuCalc().Eval("x*10")); // Returns 60; // Same as uc2.Eval("x*10");

uc1.Release();  // Since x1 is part of uc1, x1 is automatically released as well
uc2.Release();  // Since x2 is part of uc2, x2 is automatically released as well

          
DLL import code
<DllImport(uCalcDLL, CharSet:=CharSet.Ansi, CallingConvention:=CallingConvention.Cdecl, EntryPoint:="GetuCalc_Overload_Item")> _

Private Function GetuCalc_Overload_Item__(ByVal ItemHandle As IntPtr) As IntPtr
End Function
            
[DllImport(uCalcDLL, CharSet=CharSet.Ansi, CallingConvention=CallingConvention.Cdecl, EntryPoint="GetuCalc_Overload_Item")]

protected static extern IntPtr GetuCalc_Overload_Item_(IntPtr ItemHandle);
            
{DLLImport}function GetuCalc_Overload_Item__(ItemHandle: System.Pointer): System.Pointer; cdecl; external uCalcDLL name 'GetuCalc_Overload_Item';

            
typedef uCalcPtr (* __GetuCalc_Overload_Item)(void *ItemHandle); 

            
[DllImport(uCalcLib, CharSet=CharSet::Ansi, CallingConvention=CallingConvention::Cdecl, EntryPoint = "GetuCalc_Overload_Item")]

static uCalcPtr GetuCalc_Overload_Item_(void *  ItemHandle);
            
See also
uCalc (class)
Prev | Next