Basic round-trip from an item back to its parent instance.
ID: 680
See: uCalc = [uCalc]
using uCalcSoftware;
var uc = new uCalc();
var myInstance = new uCalc();
// Define a variable and get its Item object
var v = myInstance.DefineVariable("v = 10");
// Use the item to get back to its parent uCalc instance
var parentInstance = v.uCalc;
// Perform another evaluation in the same context
Console.WriteLine(parentInstance.EvalStr("v + 5"));
15 using uCalcSoftware; var uc = new uCalc(); var myInstance = new uCalc(); // Define a variable and get its Item object var v = myInstance.DefineVariable("v = 10"); // Use the item to get back to its parent uCalc instance var parentInstance = v.uCalc; // Perform another evaluation in the same context Console.WriteLine(parentInstance.EvalStr("v + 5"));
#include
#include "uCalc.h"
using namespace std;
using namespace uCalcSoftware;
int main() {
uCalc uc;
uCalc myInstance;
// Define a variable and get its Item object
auto v = myInstance.DefineVariable("v = 10");
// Use the item to get back to its parent uCalc instance
auto parentInstance = v.uCalc();
// Perform another evaluation in the same context
cout << parentInstance.EvalStr("v + 5") << endl;
}
15 #include <iostream> #include "uCalc.h" using namespace std; using namespace uCalcSoftware; int main() { uCalc uc; uCalc myInstance; // Define a variable and get its Item object auto v = myInstance.DefineVariable("v = 10"); // Use the item to get back to its parent uCalc instance auto parentInstance = v.uCalc(); // Perform another evaluation in the same context cout << parentInstance.EvalStr("v + 5") << endl; }
Imports System
Imports uCalcSoftware
Public Module Program
Public Sub Main()
Dim uc As New uCalc()
Dim myInstance As New uCalc()
'// Define a variable and get its Item object
Dim v = myInstance.DefineVariable("v = 10")
'// Use the item to get back to its parent uCalc instance
Dim parentInstance = v.uCalc
'// Perform another evaluation in the same context
Console.WriteLine(parentInstance.EvalStr("v + 5"))
End Sub
End Module
15 Imports System Imports uCalcSoftware Public Module Program Public Sub Main() Dim uc As New uCalc() Dim myInstance As New uCalc() '// Define a variable and get its Item object Dim v = myInstance.DefineVariable("v = 10") '// Use the item to get back to its parent uCalc instance Dim parentInstance = v.uCalc '// Perform another evaluation in the same context Console.WriteLine(parentInstance.EvalStr("v + 5")) End Sub End Module