uCalc.Item constructor

ID: 98

				
					using uCalcSoftware;

var uc = new uCalc();

// Note that x is defined in the default instance
// while f(x) is defined in the uc instance.
var MyVar = new uCalc.Item("Variable: x = 123");
var MyFunc = new uCalc.Item(uc, "Function: f(x) = x^2");

Console.WriteLine(uCalc.DefaultInstance.Eval("x"));
Console.WriteLine(uc.Eval("f(5)"));

MyVar.Release();
MyFunc.Release();

				
			
123
25
				
					#include <iostream>
#include "uCalc.h"

using namespace std;
using namespace uCalcSoftware;

int main() {
   uCalc uc;

   // Note that x is defined in the default instance
   // while f(x) is defined in the uc instance.
   uCalc::Item MyVar("Variable: x = 123");
   uCalc::Item MyFunc(uc, "Function: f(x) = x^2");

   cout << uCalc::DefaultInstance().Eval("x") << endl;
   cout << uc.Eval("f(5)") << endl;

   MyVar.Release();
   MyFunc.Release();

}
				
			
123
25
				
					Imports System
Imports uCalcSoftware
Public Module Program
   Public Sub Main()
      Dim uc As New uCalc()
      
      '// Note that x is defined in the default instance
      '// while f(x) is defined in the uc instance.
      Dim MyVar As New uCalc.Item("Variable: x = 123")
      Dim MyFunc As New uCalc.Item(uc, "Function: f(x) = x^2")
      
      Console.WriteLine(uCalc.DefaultInstance.Eval("x"))
      Console.WriteLine(uc.Eval("f(5)"))
      
      MyVar.Release()
      MyFunc.Release()
      
   End Sub
End Module
				
			
123
25