uCalc API Version: 5.7.0-preview.1 Released: 7/30/2026
Warning
uCalc API Preview Release Notice:This preview documentation describes the intended behavior of the API. It is not fully accurate or complete.The current preview build contains incomplete features, unoptimized performance, and is subject to breaking changes.Use of the preview version in your production code is not recommended.
Product:
Class:
Defines a new variable or array within the uCalc engine, with an optional initial value and data type.
An Item object representing the newly defined variable.
DefineVariable is the primary method for creating variables and arrays within a uCalc instance. It uses a flexible string-based syntax that allows for defining a variable's name, data type, and initial value in a single statement. This is the counterpart to DefineConstant, with the key difference that variables can be modified at runtime.
The definition string follows a simple pattern:
"VariableName [As DataType] [= InitialValueExpression]"
uc.ItemOf("_Token_Alphanumeric").Regex().As DataType (Optional): Explicitly assigns a data type (e.g., Int, String, Bool).= InitialValueExpression (Optional): Assigns an initial value. The expression is evaluated, and its result becomes the variable's starting value.If no initial value is provided, the variable is initialized to the default for its type (e.g., 0 for numbers, "" for strings).
uCalc employs a flexible type system for variables:
As keyword to specify a type (e.g., "MyInt As Int").As is omitted but an initial value is given, uCalc infers the type (e.g., "MyStr = 'hello'" becomes a String).Ptr to a data type name to create a pointer variable (e.g., Int Ptr).By default, variable names are not case-sensitive.
You can define arrays in two ways:
Fixed-Size Declaration: Specify the size within square brackets.uc.DefineVariable("MyArray[10] As Int"); // An array of 10 integers
Initializer List: Leave the brackets empty and provide a comma-separated list of initial values in curly braces. The size is inferred from the list.uc.DefineVariable("MyStrings[] = {'apple', 'banana', 'cherry'}");
A powerful feature of DefineVariable is its ability to bind a uCalc variable directly to a variable in your host application (C#, C++, etc.) via the variableAddress parameter. This creates a two-way link:
Eval("myVar = 10")) directly modify the memory of the host variable.This technique avoids the need for manually updating variables before each evaluation and is highly efficient. In C++, you can pass an address directly (e.g., &myHostVar). In C#, this typically requires pinning the object in memory using GCHandle within an unsafe context.
int x = 10;). uCalc's string-based approach ("x = 10") is dynamic, evaluated at runtime."MyVarr = 10") will result in a runtime error, not a compiler error.As Int), which is more akin to TypeScript than plain JavaScript.The unique advantage of DefineVariable lies in its memory binding capability, which provides a level of integration with native code that is uncommon in most high-level expression evaluators.
To see all defined variables, you can use ListOfItems with the property ItemIs.Variable.
ID: 305
using uCalcSoftware;
var uc = new uCalc();
uc.DefineVariable("x = 10");
Console.WriteLine(uc.Eval("x * 5"));
50 using uCalcSoftware; var uc = new uCalc(); uc.DefineVariable("x = 10"); Console.WriteLine(uc.Eval("x * 5"));
#include
#include "uCalc.h"
using namespace std;
using namespace uCalcSoftware;
int main() {
uCalc uc;
uc.DefineVariable("x = 10");
cout << uc.Eval("x * 5") << endl;
}
50 #include <iostream> #include "uCalc.h" using namespace std; using namespace uCalcSoftware; int main() { uCalc uc; uc.DefineVariable("x = 10"); cout << uc.Eval("x * 5") << endl; }
Imports System
Imports uCalcSoftware
Public Module Program
Public Sub Main()
Dim uc As New uCalc()
uc.DefineVariable("x = 10")
Console.WriteLine(uc.Eval("x * 5"))
End Sub
End Module
50 Imports System Imports uCalcSoftware Public Module Program Public Sub Main() Dim uc As New uCalc() uc.DefineVariable("x = 10") Console.WriteLine(uc.Eval("x * 5")) End Sub End Module
ID: 306
using uCalcSoftware;
var uc = new uCalc();
// Explicit type definition
uc.DefineVariable("explicitInt As Int = 123");
// Type inferred from the initial string value
uc.DefineVariable("inferredStr = 'hello'");
// Type defaults to Double as no type or value is given
var defaultVar = uc.DefineVariable("defaultVar");
Console.WriteLine($"explicitInt type: {uc.ItemOf("explicitInt").DataType.Name}");
Console.WriteLine($"inferredStr type: {uc.ItemOf("inferredStr").DataType.Name}");
Console.WriteLine($"defaultVar type: {defaultVar.DataType.Name}");
explicitInt type: int
inferredStr type: string
defaultVar type: double using uCalcSoftware; var uc = new uCalc(); // Explicit type definition uc.DefineVariable("explicitInt As Int = 123"); // Type inferred from the initial string value uc.DefineVariable("inferredStr = 'hello'"); // Type defaults to Double as no type or value is given var defaultVar = uc.DefineVariable("defaultVar"); Console.WriteLine($"explicitInt type: {uc.ItemOf("explicitInt").DataType.Name}"); Console.WriteLine($"inferredStr type: {uc.ItemOf("inferredStr").DataType.Name}"); Console.WriteLine($"defaultVar type: {defaultVar.DataType.Name}");
#include
#include "uCalc.h"
using namespace std;
using namespace uCalcSoftware;
int main() {
uCalc uc;
// Explicit type definition
uc.DefineVariable("explicitInt As Int = 123");
// Type inferred from the initial string value
uc.DefineVariable("inferredStr = 'hello'");
// Type defaults to Double as no type or value is given
auto defaultVar = uc.DefineVariable("defaultVar");
cout << "explicitInt type: " << uc.ItemOf("explicitInt").DataType().Name() << endl;
cout << "inferredStr type: " << uc.ItemOf("inferredStr").DataType().Name() << endl;
cout << "defaultVar type: " << defaultVar.DataType().Name() << endl;
}
explicitInt type: int
inferredStr type: string
defaultVar type: double #include <iostream> #include "uCalc.h" using namespace std; using namespace uCalcSoftware; int main() { uCalc uc; // Explicit type definition uc.DefineVariable("explicitInt As Int = 123"); // Type inferred from the initial string value uc.DefineVariable("inferredStr = 'hello'"); // Type defaults to Double as no type or value is given auto defaultVar = uc.DefineVariable("defaultVar"); cout << "explicitInt type: " << uc.ItemOf("explicitInt").DataType().Name() << endl; cout << "inferredStr type: " << uc.ItemOf("inferredStr").DataType().Name() << endl; cout << "defaultVar type: " << defaultVar.DataType().Name() << endl; }
Imports System
Imports uCalcSoftware
Public Module Program
Public Sub Main()
Dim uc As New uCalc()
'// Explicit type definition
uc.DefineVariable("explicitInt As Int = 123")
'// Type inferred from the initial string value
uc.DefineVariable("inferredStr = 'hello'")
'// Type defaults to Double as no type or value is given
Dim defaultVar = uc.DefineVariable("defaultVar")
Console.WriteLine($"explicitInt type: {uc.ItemOf("explicitInt").DataType.Name}")
Console.WriteLine($"inferredStr type: {uc.ItemOf("inferredStr").DataType.Name}")
Console.WriteLine($"defaultVar type: {defaultVar.DataType.Name}")
End Sub
End Module
explicitInt type: int
inferredStr type: string
defaultVar type: double Imports System Imports uCalcSoftware Public Module Program Public Sub Main() Dim uc As New uCalc() '// Explicit type definition uc.DefineVariable("explicitInt As Int = 123") '// Type inferred from the initial string value uc.DefineVariable("inferredStr = 'hello'") '// Type defaults to Double as no type or value is given Dim defaultVar = uc.DefineVariable("defaultVar") Console.WriteLine($"explicitInt type: {uc.ItemOf("explicitInt").DataType.Name}") Console.WriteLine($"inferredStr type: {uc.ItemOf("inferredStr").DataType.Name}") Console.WriteLine($"defaultVar type: {defaultVar.DataType.Name}") End Sub End Module
ID: 17
using uCalcSoftware;
var uc = new uCalc();
var MyVar = uc.DefineVariable("MyVar");
var MyInt = uc.DefineVariable("MyInt As Int");
var MyStr = uc.DefineVariable("MyStr As String");
uc.DefineVariable("OtherStr = 'string type inferred'");
uc.DefineVariable("MyInt16 = Int16(100/3)"); // type inferred
uc.DefineVariable("MyBool = True"); // type inferred
uc.DefineVariable("MyComplex = 3 + 4*#i"); // type inferred
MyVar.Value(123);
MyInt.ValueInt32(456);
MyStr.ValueStr("This is a test");
Console.WriteLine("MyVar = " + uc.EvalStr("MyVar"));
Console.WriteLine("MyInt = " + uc.EvalStr("MyInt"));
Console.WriteLine("MyStr = " + uc.EvalStr("MyStr"));
Console.WriteLine("OtherStr = " + uc.EvalStr("OtherStr"));
Console.WriteLine("MyInt16 = " + uc.EvalStr("MyInt16"));
Console.WriteLine("MyBool = " + uc.EvalStr("MyBool"));
Console.WriteLine("MyComplex = " + uc.EvalStr("MyComplex"));
Console.WriteLine("---");
Console.WriteLine(MyVar.Value());
Console.WriteLine(MyInt.ValueInt32());
Console.WriteLine(MyStr.ValueStr());
Console.WriteLine("---");
Console.WriteLine(uc.ItemOf("MyVar").DataType.Name);
Console.WriteLine(uc.ItemOf("MyInt").DataType.Name);
Console.WriteLine(uc.ItemOf("MyStr").DataType.Name);
Console.WriteLine(uc.ItemOf("OtherStr").DataType.Name);
Console.WriteLine(uc.ItemOf("MyInt16").DataType.Name);
Console.WriteLine(uc.ItemOf("MyBool").DataType.Name);
Console.WriteLine("---");
var Expression = "x^2 * 10";
var VarX = uc.DefineVariable("x");
var ParsedExpr = uc.Parse(Expression);
Console.Write("Expression = ");
Console.WriteLine(Expression);
for (int x = 1; x <= 10; x++) {
VarX.Value(x); // In C++ you can skip this by passing &x to DefineVariable
Console.WriteLine("x = " + VarX.ValueStr() + " Result = " + ParsedExpr.EvaluateStr());
}
ParsedExpr.Release();
VarX.Release();
MyVar = 123
MyInt = 456
MyStr = This is a test
OtherStr = string type inferred
MyInt16 = 33
MyBool = true
MyComplex = 3+4i
---
123
456
This is a test
---
double
int
string
string
int16
bool
---
Expression = x^2 * 10
x = 1 Result = 10
x = 2 Result = 40
x = 3 Result = 90
x = 4 Result = 160
x = 5 Result = 250
x = 6 Result = 360
x = 7 Result = 490
x = 8 Result = 640
x = 9 Result = 810
x = 10 Result = 1000 using uCalcSoftware; var uc = new uCalc(); var MyVar = uc.DefineVariable("MyVar"); var MyInt = uc.DefineVariable("MyInt As Int"); var MyStr = uc.DefineVariable("MyStr As String"); uc.DefineVariable("OtherStr = 'string type inferred'"); uc.DefineVariable("MyInt16 = Int16(100/3)"); // type inferred uc.DefineVariable("MyBool = True"); // type inferred uc.DefineVariable("MyComplex = 3 + 4*#i"); // type inferred MyVar.Value(123); MyInt.ValueInt32(456); MyStr.ValueStr("This is a test"); Console.WriteLine("MyVar = " + uc.EvalStr("MyVar")); Console.WriteLine("MyInt = " + uc.EvalStr("MyInt")); Console.WriteLine("MyStr = " + uc.EvalStr("MyStr")); Console.WriteLine("OtherStr = " + uc.EvalStr("OtherStr")); Console.WriteLine("MyInt16 = " + uc.EvalStr("MyInt16")); Console.WriteLine("MyBool = " + uc.EvalStr("MyBool")); Console.WriteLine("MyComplex = " + uc.EvalStr("MyComplex")); Console.WriteLine("---"); Console.WriteLine(MyVar.Value()); Console.WriteLine(MyInt.ValueInt32()); Console.WriteLine(MyStr.ValueStr()); Console.WriteLine("---"); Console.WriteLine(uc.ItemOf("MyVar").DataType.Name); Console.WriteLine(uc.ItemOf("MyInt").DataType.Name); Console.WriteLine(uc.ItemOf("MyStr").DataType.Name); Console.WriteLine(uc.ItemOf("OtherStr").DataType.Name); Console.WriteLine(uc.ItemOf("MyInt16").DataType.Name); Console.WriteLine(uc.ItemOf("MyBool").DataType.Name); Console.WriteLine("---"); var Expression = "x^2 * 10"; var VarX = uc.DefineVariable("x"); var ParsedExpr = uc.Parse(Expression); Console.Write("Expression = "); Console.WriteLine(Expression); for (int x = 1; x <= 10; x++) { VarX.Value(x); // In C++ you can skip this by passing &x to DefineVariable Console.WriteLine("x = " + VarX.ValueStr() + " Result = " + ParsedExpr.EvaluateStr()); } ParsedExpr.Release(); VarX.Release();
#include
#include "uCalc.h"
using namespace std;
using namespace uCalcSoftware;
int main() {
uCalc uc;
auto MyVar = uc.DefineVariable("MyVar");
auto MyInt = uc.DefineVariable("MyInt As Int");
auto MyStr = uc.DefineVariable("MyStr As String");
uc.DefineVariable("OtherStr = 'string type inferred'");
uc.DefineVariable("MyInt16 = Int16(100/3)"); // type inferred
uc.DefineVariable("MyBool = True"); // type inferred
uc.DefineVariable("MyComplex = 3 + 4*#i"); // type inferred
MyVar.Value(123);
MyInt.ValueInt32(456);
MyStr.ValueStr("This is a test");
cout << "MyVar = " + uc.EvalStr("MyVar") << endl;
cout << "MyInt = " + uc.EvalStr("MyInt") << endl;
cout << "MyStr = " + uc.EvalStr("MyStr") << endl;
cout << "OtherStr = " + uc.EvalStr("OtherStr") << endl;
cout << "MyInt16 = " + uc.EvalStr("MyInt16") << endl;
cout << "MyBool = " + uc.EvalStr("MyBool") << endl;
cout << "MyComplex = " + uc.EvalStr("MyComplex") << endl;
cout << "---" << endl;
cout << MyVar.Value() << endl;
cout << MyInt.ValueInt32() << endl;
cout << MyStr.ValueStr() << endl;
cout << "---" << endl;
cout << uc.ItemOf("MyVar").DataType().Name() << endl;
cout << uc.ItemOf("MyInt").DataType().Name() << endl;
cout << uc.ItemOf("MyStr").DataType().Name() << endl;
cout << uc.ItemOf("OtherStr").DataType().Name() << endl;
cout << uc.ItemOf("MyInt16").DataType().Name() << endl;
cout << uc.ItemOf("MyBool").DataType().Name() << endl;
cout << "---" << endl;
auto Expression = "x^2 * 10";
auto VarX = uc.DefineVariable("x");
auto ParsedExpr = uc.Parse(Expression);
cout << "Expression = ";
cout << Expression << endl;
for (int x = 1; x <= 10; x++) {
VarX.Value(x); // In C++ you can skip this by passing &x to DefineVariable
cout << "x = " + VarX.ValueStr() + " Result = " + ParsedExpr.EvaluateStr() << endl;
}
ParsedExpr.Release();
VarX.Release();
}
MyVar = 123
MyInt = 456
MyStr = This is a test
OtherStr = string type inferred
MyInt16 = 33
MyBool = true
MyComplex = 3+4i
---
123
456
This is a test
---
double
int
string
string
int16
bool
---
Expression = x^2 * 10
x = 1 Result = 10
x = 2 Result = 40
x = 3 Result = 90
x = 4 Result = 160
x = 5 Result = 250
x = 6 Result = 360
x = 7 Result = 490
x = 8 Result = 640
x = 9 Result = 810
x = 10 Result = 1000 #include <iostream> #include "uCalc.h" using namespace std; using namespace uCalcSoftware; int main() { uCalc uc; auto MyVar = uc.DefineVariable("MyVar"); auto MyInt = uc.DefineVariable("MyInt As Int"); auto MyStr = uc.DefineVariable("MyStr As String"); uc.DefineVariable("OtherStr = 'string type inferred'"); uc.DefineVariable("MyInt16 = Int16(100/3)"); // type inferred uc.DefineVariable("MyBool = True"); // type inferred uc.DefineVariable("MyComplex = 3 + 4*#i"); // type inferred MyVar.Value(123); MyInt.ValueInt32(456); MyStr.ValueStr("This is a test"); cout << "MyVar = " + uc.EvalStr("MyVar") << endl; cout << "MyInt = " + uc.EvalStr("MyInt") << endl; cout << "MyStr = " + uc.EvalStr("MyStr") << endl; cout << "OtherStr = " + uc.EvalStr("OtherStr") << endl; cout << "MyInt16 = " + uc.EvalStr("MyInt16") << endl; cout << "MyBool = " + uc.EvalStr("MyBool") << endl; cout << "MyComplex = " + uc.EvalStr("MyComplex") << endl; cout << "---" << endl; cout << MyVar.Value() << endl; cout << MyInt.ValueInt32() << endl; cout << MyStr.ValueStr() << endl; cout << "---" << endl; cout << uc.ItemOf("MyVar").DataType().Name() << endl; cout << uc.ItemOf("MyInt").DataType().Name() << endl; cout << uc.ItemOf("MyStr").DataType().Name() << endl; cout << uc.ItemOf("OtherStr").DataType().Name() << endl; cout << uc.ItemOf("MyInt16").DataType().Name() << endl; cout << uc.ItemOf("MyBool").DataType().Name() << endl; cout << "---" << endl; auto Expression = "x^2 * 10"; auto VarX = uc.DefineVariable("x"); auto ParsedExpr = uc.Parse(Expression); cout << "Expression = "; cout << Expression << endl; for (int x = 1; x <= 10; x++) { VarX.Value(x); // In C++ you can skip this by passing &x to DefineVariable cout << "x = " + VarX.ValueStr() + " Result = " + ParsedExpr.EvaluateStr() << endl; } ParsedExpr.Release(); VarX.Release(); }
Imports System
Imports uCalcSoftware
Public Module Program
Public Sub Main()
Dim uc As New uCalc()
Dim MyVar = uc.DefineVariable("MyVar")
Dim MyInt = uc.DefineVariable("MyInt As Int")
Dim MyStr = uc.DefineVariable("MyStr As String")
uc.DefineVariable("OtherStr = 'string type inferred'")
uc.DefineVariable("MyInt16 = Int16(100/3)") '// type inferred
uc.DefineVariable("MyBool = True") '// type inferred
uc.DefineVariable("MyComplex = 3 + 4*#i") '// type inferred
MyVar.Value(123)
MyInt.ValueInt32(456)
MyStr.ValueStr("This is a test")
Console.WriteLine("MyVar = " + uc.EvalStr("MyVar"))
Console.WriteLine("MyInt = " + uc.EvalStr("MyInt"))
Console.WriteLine("MyStr = " + uc.EvalStr("MyStr"))
Console.WriteLine("OtherStr = " + uc.EvalStr("OtherStr"))
Console.WriteLine("MyInt16 = " + uc.EvalStr("MyInt16"))
Console.WriteLine("MyBool = " + uc.EvalStr("MyBool"))
Console.WriteLine("MyComplex = " + uc.EvalStr("MyComplex"))
Console.WriteLine("---")
Console.WriteLine(MyVar.Value())
Console.WriteLine(MyInt.ValueInt32())
Console.WriteLine(MyStr.ValueStr())
Console.WriteLine("---")
Console.WriteLine(uc.ItemOf("MyVar").DataType.Name)
Console.WriteLine(uc.ItemOf("MyInt").DataType.Name)
Console.WriteLine(uc.ItemOf("MyStr").DataType.Name)
Console.WriteLine(uc.ItemOf("OtherStr").DataType.Name)
Console.WriteLine(uc.ItemOf("MyInt16").DataType.Name)
Console.WriteLine(uc.ItemOf("MyBool").DataType.Name)
Console.WriteLine("---")
Dim Expression = "x^2 * 10"
Dim VarX = uc.DefineVariable("x")
Dim ParsedExpr = uc.Parse(Expression)
Console.Write("Expression = ")
Console.WriteLine(Expression)
For x As Integer = 1 To 10
VarX.Value(x) '// In C++ you can skip this by passing &x to DefineVariable
Console.WriteLine("x = " + VarX.ValueStr() + " Result = " + ParsedExpr.EvaluateStr())
Next
ParsedExpr.Release()
VarX.Release()
End Sub
End Module
MyVar = 123
MyInt = 456
MyStr = This is a test
OtherStr = string type inferred
MyInt16 = 33
MyBool = true
MyComplex = 3+4i
---
123
456
This is a test
---
double
int
string
string
int16
bool
---
Expression = x^2 * 10
x = 1 Result = 10
x = 2 Result = 40
x = 3 Result = 90
x = 4 Result = 160
x = 5 Result = 250
x = 6 Result = 360
x = 7 Result = 490
x = 8 Result = 640
x = 9 Result = 810
x = 10 Result = 1000 Imports System Imports uCalcSoftware Public Module Program Public Sub Main() Dim uc As New uCalc() Dim MyVar = uc.DefineVariable("MyVar") Dim MyInt = uc.DefineVariable("MyInt As Int") Dim MyStr = uc.DefineVariable("MyStr As String") uc.DefineVariable("OtherStr = 'string type inferred'") uc.DefineVariable("MyInt16 = Int16(100/3)") '// type inferred uc.DefineVariable("MyBool = True") '// type inferred uc.DefineVariable("MyComplex = 3 + 4*#i") '// type inferred MyVar.Value(123) MyInt.ValueInt32(456) MyStr.ValueStr("This is a test") Console.WriteLine("MyVar = " + uc.EvalStr("MyVar")) Console.WriteLine("MyInt = " + uc.EvalStr("MyInt")) Console.WriteLine("MyStr = " + uc.EvalStr("MyStr")) Console.WriteLine("OtherStr = " + uc.EvalStr("OtherStr")) Console.WriteLine("MyInt16 = " + uc.EvalStr("MyInt16")) Console.WriteLine("MyBool = " + uc.EvalStr("MyBool")) Console.WriteLine("MyComplex = " + uc.EvalStr("MyComplex")) Console.WriteLine("---") Console.WriteLine(MyVar.Value()) Console.WriteLine(MyInt.ValueInt32()) Console.WriteLine(MyStr.ValueStr()) Console.WriteLine("---") Console.WriteLine(uc.ItemOf("MyVar").DataType.Name) Console.WriteLine(uc.ItemOf("MyInt").DataType.Name) Console.WriteLine(uc.ItemOf("MyStr").DataType.Name) Console.WriteLine(uc.ItemOf("OtherStr").DataType.Name) Console.WriteLine(uc.ItemOf("MyInt16").DataType.Name) Console.WriteLine(uc.ItemOf("MyBool").DataType.Name) Console.WriteLine("---") Dim Expression = "x^2 * 10" Dim VarX = uc.DefineVariable("x") Dim ParsedExpr = uc.Parse(Expression) Console.Write("Expression = ") Console.WriteLine(Expression) For x As Integer = 1 To 10 VarX.Value(x) '// In C++ you can skip this by passing &x to DefineVariable Console.WriteLine("x = " + VarX.ValueStr() + " Result = " + ParsedExpr.EvaluateStr()) Next ParsedExpr.Release() VarX.Release() End Sub End Module
ID: 18
using uCalcSoftware;
var uc = new uCalc();
var Int8Var = uc.DefineVariable("x As Int8 = -1");
var Int16Var = uc.DefineVariable("y As Int16 = -1");
var StrVar = uc.DefineVariable("MyStr = 'Hello there'");
Console.WriteLine(uc.EvalStr("x"));
Console.WriteLine(uc.EvalStr("y"));
Console.WriteLine(uc.EvalStr("MyStr"));
var xPtr = uc.DefineVariable("xPtr As Pointer"); // General pointer
var yPtr = uc.DefineVariable("yPtr As Int16u Ptr"); // pointer specific to unsigned Int16
var yPtrB = uc.DefineVariable("yPtrB As Int16 Ptr = AddressOf(y)"); // Using AddressOf
var StrPtr = uc.DefineVariable("StrPtr As String Ptr");
xPtr.ValuePtr(Int8Var.ValueAddr()); // Sets the pointer address
yPtr.ValuePtr(Int16Var.ValueAddr()); // Note: address of signed Int16 going to an unsigned Ptr
StrPtr.ValuePtr(StrVar.ValueAddr());
// Note: for the ints we are now returning unsigned values; so -1 turns into positive numbers
Console.WriteLine(uc.EvalStr("ValueAt(Int8u, xPtr)")); // Type required because it's defined as generar pointer
Console.WriteLine(uc.EvalStr("ValueAt(yPtr)")); // Type name not needed because it's defined as Int16u Ptr
Console.WriteLine(uc.EvalStr("ValueAt(yPtrB)"));
Console.WriteLine(uc.EvalStr("ValueAt(StrPtr)"));
// Iterate through uc.ItemOf(ItemIs.DataType, n).Name()
// to see data type names you can use with ValueAt
var OtherInt = uc.DefineVariable("OtherInt As Int16 = 1234");
uc.DataTypeOf(BuiltInType.Integer_16).SetScalar(Int16Var.ValueAddr(), OtherInt.ValueAddr());
Console.WriteLine(uc.EvalStr("OtherInt"));
Console.WriteLine(uc.EvalStr("ValueAt(yPtrB)"));
-1
-1
Hello there
255
65535
-1
Hello there
1234
1234 using uCalcSoftware; var uc = new uCalc(); var Int8Var = uc.DefineVariable("x As Int8 = -1"); var Int16Var = uc.DefineVariable("y As Int16 = -1"); var StrVar = uc.DefineVariable("MyStr = 'Hello there'"); Console.WriteLine(uc.EvalStr("x")); Console.WriteLine(uc.EvalStr("y")); Console.WriteLine(uc.EvalStr("MyStr")); var xPtr = uc.DefineVariable("xPtr As Pointer"); // General pointer var yPtr = uc.DefineVariable("yPtr As Int16u Ptr"); // pointer specific to unsigned Int16 var yPtrB = uc.DefineVariable("yPtrB As Int16 Ptr = AddressOf(y)"); // Using AddressOf var StrPtr = uc.DefineVariable("StrPtr As String Ptr"); xPtr.ValuePtr(Int8Var.ValueAddr()); // Sets the pointer address yPtr.ValuePtr(Int16Var.ValueAddr()); // Note: address of signed Int16 going to an unsigned Ptr StrPtr.ValuePtr(StrVar.ValueAddr()); // Note: for the ints we are now returning unsigned values; so -1 turns into positive numbers Console.WriteLine(uc.EvalStr("ValueAt(Int8u, xPtr)")); // Type required because it's defined as generar pointer Console.WriteLine(uc.EvalStr("ValueAt(yPtr)")); // Type name not needed because it's defined as Int16u Ptr Console.WriteLine(uc.EvalStr("ValueAt(yPtrB)")); Console.WriteLine(uc.EvalStr("ValueAt(StrPtr)")); // Iterate through uc.ItemOf(ItemIs.DataType, n).Name() // to see data type names you can use with ValueAt var OtherInt = uc.DefineVariable("OtherInt As Int16 = 1234"); uc.DataTypeOf(BuiltInType.Integer_16).SetScalar(Int16Var.ValueAddr(), OtherInt.ValueAddr()); Console.WriteLine(uc.EvalStr("OtherInt")); Console.WriteLine(uc.EvalStr("ValueAt(yPtrB)"));
#include
#include "uCalc.h"
using namespace std;
using namespace uCalcSoftware;
int main() {
uCalc uc;
auto Int8Var = uc.DefineVariable("x As Int8 = -1");
auto Int16Var = uc.DefineVariable("y As Int16 = -1");
auto StrVar = uc.DefineVariable("MyStr = 'Hello there'");
cout << uc.EvalStr("x") << endl;
cout << uc.EvalStr("y") << endl;
cout << uc.EvalStr("MyStr") << endl;
auto xPtr = uc.DefineVariable("xPtr As Pointer"); // General pointer
auto yPtr = uc.DefineVariable("yPtr As Int16u Ptr"); // pointer specific to unsigned Int16
auto yPtrB = uc.DefineVariable("yPtrB As Int16 Ptr = AddressOf(y)"); // Using AddressOf
auto StrPtr = uc.DefineVariable("StrPtr As String Ptr");
xPtr.ValuePtr(Int8Var.ValueAddr()); // Sets the pointer address
yPtr.ValuePtr(Int16Var.ValueAddr()); // Note: address of signed Int16 going to an unsigned Ptr
StrPtr.ValuePtr(StrVar.ValueAddr());
// Note: for the ints we are now returning unsigned values; so -1 turns into positive numbers
cout << uc.EvalStr("ValueAt(Int8u, xPtr)") << endl; // Type required because it's defined as generar pointer
cout << uc.EvalStr("ValueAt(yPtr)") << endl; // Type name not needed because it's defined as Int16u Ptr
cout << uc.EvalStr("ValueAt(yPtrB)") << endl;
cout << uc.EvalStr("ValueAt(StrPtr)") << endl;
// Iterate through uc.ItemOf(ItemIs.DataType, n).Name()
// to see data type names you can use with ValueAt
auto OtherInt = uc.DefineVariable("OtherInt As Int16 = 1234");
uc.DataTypeOf(BuiltInType::Integer_16).SetScalar(Int16Var.ValueAddr(), OtherInt.ValueAddr());
cout << uc.EvalStr("OtherInt") << endl;
cout << uc.EvalStr("ValueAt(yPtrB)") << endl;
}
-1
-1
Hello there
255
65535
-1
Hello there
1234
1234 #include <iostream> #include "uCalc.h" using namespace std; using namespace uCalcSoftware; int main() { uCalc uc; auto Int8Var = uc.DefineVariable("x As Int8 = -1"); auto Int16Var = uc.DefineVariable("y As Int16 = -1"); auto StrVar = uc.DefineVariable("MyStr = 'Hello there'"); cout << uc.EvalStr("x") << endl; cout << uc.EvalStr("y") << endl; cout << uc.EvalStr("MyStr") << endl; auto xPtr = uc.DefineVariable("xPtr As Pointer"); // General pointer auto yPtr = uc.DefineVariable("yPtr As Int16u Ptr"); // pointer specific to unsigned Int16 auto yPtrB = uc.DefineVariable("yPtrB As Int16 Ptr = AddressOf(y)"); // Using AddressOf auto StrPtr = uc.DefineVariable("StrPtr As String Ptr"); xPtr.ValuePtr(Int8Var.ValueAddr()); // Sets the pointer address yPtr.ValuePtr(Int16Var.ValueAddr()); // Note: address of signed Int16 going to an unsigned Ptr StrPtr.ValuePtr(StrVar.ValueAddr()); // Note: for the ints we are now returning unsigned values; so -1 turns into positive numbers cout << uc.EvalStr("ValueAt(Int8u, xPtr)") << endl; // Type required because it's defined as generar pointer cout << uc.EvalStr("ValueAt(yPtr)") << endl; // Type name not needed because it's defined as Int16u Ptr cout << uc.EvalStr("ValueAt(yPtrB)") << endl; cout << uc.EvalStr("ValueAt(StrPtr)") << endl; // Iterate through uc.ItemOf(ItemIs.DataType, n).Name() // to see data type names you can use with ValueAt auto OtherInt = uc.DefineVariable("OtherInt As Int16 = 1234"); uc.DataTypeOf(BuiltInType::Integer_16).SetScalar(Int16Var.ValueAddr(), OtherInt.ValueAddr()); cout << uc.EvalStr("OtherInt") << endl; cout << uc.EvalStr("ValueAt(yPtrB)") << endl; }
Imports System
Imports uCalcSoftware
Public Module Program
Public Sub Main()
Dim uc As New uCalc()
Dim Int8Var = uc.DefineVariable("x As Int8 = -1")
Dim Int16Var = uc.DefineVariable("y As Int16 = -1")
Dim StrVar = uc.DefineVariable("MyStr = 'Hello there'")
Console.WriteLine(uc.EvalStr("x"))
Console.WriteLine(uc.EvalStr("y"))
Console.WriteLine(uc.EvalStr("MyStr"))
Dim xPtr = uc.DefineVariable("xPtr As Pointer") '// General pointer
Dim yPtr = uc.DefineVariable("yPtr As Int16u Ptr") '// pointer specific to unsigned Int16
Dim yPtrB = uc.DefineVariable("yPtrB As Int16 Ptr = AddressOf(y)") '// Using AddressOf
Dim StrPtr = uc.DefineVariable("StrPtr As String Ptr")
xPtr.ValuePtr(Int8Var.ValueAddr()) '// Sets the pointer address
yPtr.ValuePtr(Int16Var.ValueAddr()) '// Note: address of signed Int16 going to an unsigned Ptr
StrPtr.ValuePtr(StrVar.ValueAddr())
'// Note: for the ints we are now returning unsigned values; so -1 turns into positive numbers
Console.WriteLine(uc.EvalStr("ValueAt(Int8u, xPtr)")) '// Type required because it's defined as generar pointer
Console.WriteLine(uc.EvalStr("ValueAt(yPtr)")) '// Type name not needed because it's defined as Int16u Ptr
Console.WriteLine(uc.EvalStr("ValueAt(yPtrB)"))
Console.WriteLine(uc.EvalStr("ValueAt(StrPtr)"))
'// Iterate through uc.ItemOf(ItemIs.DataType, n).Name()
'// to see data type names you can use with ValueAt
Dim OtherInt = uc.DefineVariable("OtherInt As Int16 = 1234")
uc.DataTypeOf(BuiltInType.Integer_16).SetScalar(Int16Var.ValueAddr(), OtherInt.ValueAddr())
Console.WriteLine(uc.EvalStr("OtherInt"))
Console.WriteLine(uc.EvalStr("ValueAt(yPtrB)"))
End Sub
End Module
-1
-1
Hello there
255
65535
-1
Hello there
1234
1234 Imports System Imports uCalcSoftware Public Module Program Public Sub Main() Dim uc As New uCalc() Dim Int8Var = uc.DefineVariable("x As Int8 = -1") Dim Int16Var = uc.DefineVariable("y As Int16 = -1") Dim StrVar = uc.DefineVariable("MyStr = 'Hello there'") Console.WriteLine(uc.EvalStr("x")) Console.WriteLine(uc.EvalStr("y")) Console.WriteLine(uc.EvalStr("MyStr")) Dim xPtr = uc.DefineVariable("xPtr As Pointer") '// General pointer Dim yPtr = uc.DefineVariable("yPtr As Int16u Ptr") '// pointer specific to unsigned Int16 Dim yPtrB = uc.DefineVariable("yPtrB As Int16 Ptr = AddressOf(y)") '// Using AddressOf Dim StrPtr = uc.DefineVariable("StrPtr As String Ptr") xPtr.ValuePtr(Int8Var.ValueAddr()) '// Sets the pointer address yPtr.ValuePtr(Int16Var.ValueAddr()) '// Note: address of signed Int16 going to an unsigned Ptr StrPtr.ValuePtr(StrVar.ValueAddr()) '// Note: for the ints we are now returning unsigned values; so -1 turns into positive numbers Console.WriteLine(uc.EvalStr("ValueAt(Int8u, xPtr)")) '// Type required because it's defined as generar pointer Console.WriteLine(uc.EvalStr("ValueAt(yPtr)")) '// Type name not needed because it's defined as Int16u Ptr Console.WriteLine(uc.EvalStr("ValueAt(yPtrB)")) Console.WriteLine(uc.EvalStr("ValueAt(StrPtr)")) '// Iterate through uc.ItemOf(ItemIs.DataType, n).Name() '// to see data type names you can use with ValueAt Dim OtherInt = uc.DefineVariable("OtherInt As Int16 = 1234") uc.DataTypeOf(BuiltInType.Integer_16).SetScalar(Int16Var.ValueAddr(), OtherInt.ValueAddr()) Console.WriteLine(uc.EvalStr("OtherInt")) Console.WriteLine(uc.EvalStr("ValueAt(yPtrB)")) End Sub End Module
ID: 67
using uCalcSoftware;
var uc = new uCalc();
var MyArray = uc.DefineVariable("MyArray[3]");
uc.DefineVariable("MyArrayStr[] = {'aa', 'bb', 'cc'}");
uc.Eval("MyArray[0] = 111; MyArray[1] = 222; MyArray[2] = 333");
Console.WriteLine(uc.EvalStr("MyArray[0]"));
Console.WriteLine(uc.EvalStr("MyArray[1]"));
Console.WriteLine(uc.EvalStr("MyArray[2]"));
Console.WriteLine(uc.EvalStr("MyArrayStr[0]"));
Console.WriteLine(uc.EvalStr("MyArrayStr[1]"));
Console.WriteLine(uc.EvalStr("MyArrayStr[2]"));
Console.WriteLine(MyArray.Count);
Console.WriteLine(uc.ItemOf("MyArrayStr").Count);
111
222
333
aa
bb
cc
3
3 using uCalcSoftware; var uc = new uCalc(); var MyArray = uc.DefineVariable("MyArray[3]"); uc.DefineVariable("MyArrayStr[] = {'aa', 'bb', 'cc'}"); uc.Eval("MyArray[0] = 111; MyArray[1] = 222; MyArray[2] = 333"); Console.WriteLine(uc.EvalStr("MyArray[0]")); Console.WriteLine(uc.EvalStr("MyArray[1]")); Console.WriteLine(uc.EvalStr("MyArray[2]")); Console.WriteLine(uc.EvalStr("MyArrayStr[0]")); Console.WriteLine(uc.EvalStr("MyArrayStr[1]")); Console.WriteLine(uc.EvalStr("MyArrayStr[2]")); Console.WriteLine(MyArray.Count); Console.WriteLine(uc.ItemOf("MyArrayStr").Count);
#include
#include "uCalc.h"
using namespace std;
using namespace uCalcSoftware;
int main() {
uCalc uc;
auto MyArray = uc.DefineVariable("MyArray[3]");
uc.DefineVariable("MyArrayStr[] = {'aa', 'bb', 'cc'}");
uc.Eval("MyArray[0] = 111; MyArray[1] = 222; MyArray[2] = 333");
cout << uc.EvalStr("MyArray[0]") << endl;
cout << uc.EvalStr("MyArray[1]") << endl;
cout << uc.EvalStr("MyArray[2]") << endl;
cout << uc.EvalStr("MyArrayStr[0]") << endl;
cout << uc.EvalStr("MyArrayStr[1]") << endl;
cout << uc.EvalStr("MyArrayStr[2]") << endl;
cout << MyArray.Count() << endl;
cout << uc.ItemOf("MyArrayStr").Count() << endl;
}
111
222
333
aa
bb
cc
3
3 #include <iostream> #include "uCalc.h" using namespace std; using namespace uCalcSoftware; int main() { uCalc uc; auto MyArray = uc.DefineVariable("MyArray[3]"); uc.DefineVariable("MyArrayStr[] = {'aa', 'bb', 'cc'}"); uc.Eval("MyArray[0] = 111; MyArray[1] = 222; MyArray[2] = 333"); cout << uc.EvalStr("MyArray[0]") << endl; cout << uc.EvalStr("MyArray[1]") << endl; cout << uc.EvalStr("MyArray[2]") << endl; cout << uc.EvalStr("MyArrayStr[0]") << endl; cout << uc.EvalStr("MyArrayStr[1]") << endl; cout << uc.EvalStr("MyArrayStr[2]") << endl; cout << MyArray.Count() << endl; cout << uc.ItemOf("MyArrayStr").Count() << endl; }
Imports System
Imports uCalcSoftware
Public Module Program
Public Sub Main()
Dim uc As New uCalc()
Dim MyArray = uc.DefineVariable("MyArray[3]")
uc.DefineVariable("MyArrayStr[] = {'aa', 'bb', 'cc'}")
uc.Eval("MyArray[0] = 111; MyArray[1] = 222; MyArray[2] = 333")
Console.WriteLine(uc.EvalStr("MyArray[0]"))
Console.WriteLine(uc.EvalStr("MyArray[1]"))
Console.WriteLine(uc.EvalStr("MyArray[2]"))
Console.WriteLine(uc.EvalStr("MyArrayStr[0]"))
Console.WriteLine(uc.EvalStr("MyArrayStr[1]"))
Console.WriteLine(uc.EvalStr("MyArrayStr[2]"))
Console.WriteLine(MyArray.Count)
Console.WriteLine(uc.ItemOf("MyArrayStr").Count)
End Sub
End Module
111
222
333
aa
bb
cc
3
3 Imports System Imports uCalcSoftware Public Module Program Public Sub Main() Dim uc As New uCalc() Dim MyArray = uc.DefineVariable("MyArray[3]") uc.DefineVariable("MyArrayStr[] = {'aa', 'bb', 'cc'}") uc.Eval("MyArray[0] = 111; MyArray[1] = 222; MyArray[2] = 333") Console.WriteLine(uc.EvalStr("MyArray[0]")) Console.WriteLine(uc.EvalStr("MyArray[1]")) Console.WriteLine(uc.EvalStr("MyArray[2]")) Console.WriteLine(uc.EvalStr("MyArrayStr[0]")) Console.WriteLine(uc.EvalStr("MyArrayStr[1]")) Console.WriteLine(uc.EvalStr("MyArrayStr[2]")) Console.WriteLine(MyArray.Count) Console.WriteLine(uc.ItemOf("MyArrayStr").Count) End Sub End Module
ID: 1460
using uCalcSoftware;
var uc = new uCalc();
var variableX = uc.DefineVariable("x");
var userExpression = "x * 2 + 5";
var Total = 0.0;
var UpperBound = 1000000; // One million
// Parse the expression just once before the loop begins.
var parsedExpr = uc.Parse(userExpression);
var stopwatch = System.Diagnostics.Stopwatch.StartNew();
for (double x = 1; x <= UpperBound; x++) {
variableX.Value(x);
Total = Total + parsedExpr.Evaluate();
}
stopwatch.Stop();
//Uncomment the following line to reveal the actual speed:
//Console.WriteLine($"Elapsed Milliseconds: {stopwatch.ElapsedMilliseconds} ms");
Console.Write("Sum(1, "); Console.Write(UpperBound); Console.Write(", "); Console.Write(userExpression); Console.Write(") = "); Console.Write(Total);
Sum(1, 1000000, x * 2 + 5) = 1000006000000 using uCalcSoftware; var uc = new uCalc(); var variableX = uc.DefineVariable("x"); var userExpression = "x * 2 + 5"; var Total = 0.0; var UpperBound = 1000000; // One million // Parse the expression just once before the loop begins. var parsedExpr = uc.Parse(userExpression); var stopwatch = System.Diagnostics.Stopwatch.StartNew(); for (double x = 1; x <= UpperBound; x++) { variableX.Value(x); Total = Total + parsedExpr.Evaluate(); } stopwatch.Stop(); //Uncomment the following line to reveal the actual speed: //Console.WriteLine($"Elapsed Milliseconds: {stopwatch.ElapsedMilliseconds} ms"); Console.Write("Sum(1, "); Console.Write(UpperBound); Console.Write(", "); Console.Write(userExpression); Console.Write(") = "); Console.Write(Total);
#include
#include "uCalc.h"
using namespace std;
using namespace uCalcSoftware;
int main() {
uCalc uc;
auto variableX = uc.DefineVariable("x");
auto userExpression = "x * 2 + 5";
auto Total = 0.0;
auto UpperBound = 1000000; // One million
// Parse the expression just once before the loop begins.
auto parsedExpr = uc.Parse(userExpression);
for (double x = 1; x <= UpperBound; x++) {
variableX.Value(x);
Total = Total + parsedExpr.Evaluate();
}
cout << "Sum(1, " << UpperBound << ", " << userExpression << ") = " << (long long)Total;
}
Sum(1, 1000000, x * 2 + 5) = 1000006000000 #include <iostream> #include "uCalc.h" using namespace std; using namespace uCalcSoftware; int main() { uCalc uc; auto variableX = uc.DefineVariable("x"); auto userExpression = "x * 2 + 5"; auto Total = 0.0; auto UpperBound = 1000000; // One million // Parse the expression just once before the loop begins. auto parsedExpr = uc.Parse(userExpression); for (double x = 1; x <= UpperBound; x++) { variableX.Value(x); Total = Total + parsedExpr.Evaluate(); } cout << "Sum(1, " << UpperBound << ", " << userExpression << ") = " << (long long)Total; }
Imports System
Imports uCalcSoftware
Public Module Program
Public Sub Main()
Dim uc As New uCalc()
Dim variableX = uc.DefineVariable("x")
Dim userExpression = "x * 2 + 5"
Dim Total = 0.0
Dim UpperBound = 1000000 '// One million
'// Parse the expression just once before the loop begins.
Dim parsedExpr = uc.Parse(userExpression)
Dim stopwatch = System.Diagnostics.Stopwatch.StartNew()
For x As Double = 1 To UpperBound
variableX.Value(x)
Total = Total + parsedExpr.Evaluate()
Next
stopwatch.Stop()
'//Uncomment the following line to reveal the actual speed:
'//Console.WriteLine($"Elapsed Milliseconds: {stopwatch.ElapsedMilliseconds} ms");
Console.Write("Sum(1, ")
Console.Write(UpperBound)
Console.Write(", ")
Console.Write(userExpression)
Console.Write(") = ")
Console.Write(Total)
End Sub
End Module
Sum(1, 1000000, x * 2 + 5) = 1000006000000 Imports System Imports uCalcSoftware Public Module Program Public Sub Main() Dim uc As New uCalc() Dim variableX = uc.DefineVariable("x") Dim userExpression = "x * 2 + 5" Dim Total = 0.0 Dim UpperBound = 1000000 '// One million '// Parse the expression just once before the loop begins. Dim parsedExpr = uc.Parse(userExpression) Dim stopwatch = System.Diagnostics.Stopwatch.StartNew() For x As Double = 1 To UpperBound variableX.Value(x) Total = Total + parsedExpr.Evaluate() Next stopwatch.Stop() '//Uncomment the following line to reveal the actual speed: '//Console.WriteLine($"Elapsed Milliseconds: {stopwatch.ElapsedMilliseconds} ms"); Console.Write("Sum(1, ") Console.Write(UpperBound) Console.Write(", ") Console.Write(userExpression) Console.Write(") = ") Console.Write(Total) End Sub End Module
ID: 1296
using uCalcSoftware;
var uc = new uCalc();
uc.DefineVariable("x = 10");
uc.DefineFunction("DoubleThis(n) = n * 2");
Console.WriteLine(uc.Eval("DoubleThis(x) + 5"));
25 using uCalcSoftware; var uc = new uCalc(); uc.DefineVariable("x = 10"); uc.DefineFunction("DoubleThis(n) = n * 2"); Console.WriteLine(uc.Eval("DoubleThis(x) + 5"));
#include
#include "uCalc.h"
using namespace std;
using namespace uCalcSoftware;
int main() {
uCalc uc;
uc.DefineVariable("x = 10");
uc.DefineFunction("DoubleThis(n) = n * 2");
cout << uc.Eval("DoubleThis(x) + 5") << endl;
}
25 #include <iostream> #include "uCalc.h" using namespace std; using namespace uCalcSoftware; int main() { uCalc uc; uc.DefineVariable("x = 10"); uc.DefineFunction("DoubleThis(n) = n * 2"); cout << uc.Eval("DoubleThis(x) + 5") << endl; }
Imports System
Imports uCalcSoftware
Public Module Program
Public Sub Main()
Dim uc As New uCalc()
uc.DefineVariable("x = 10")
uc.DefineFunction("DoubleThis(n) = n * 2")
Console.WriteLine(uc.Eval("DoubleThis(x) + 5"))
End Sub
End Module
25 Imports System Imports uCalcSoftware Public Module Program Public Sub Main() Dim uc As New uCalc() uc.DefineVariable("x = 10") uc.DefineFunction("DoubleThis(n) = n * 2") Console.WriteLine(uc.Eval("DoubleThis(x) + 5")) End Sub End Module
ID: 296
using uCalcSoftware;
var uc = new uCalc();
uc.DefineVariable("x = 5");
uc.DefineFunction("Area(length, width) = length * width");
Console.WriteLine(uc.Eval("Area(4, x) + 7"));
27 using uCalcSoftware; var uc = new uCalc(); uc.DefineVariable("x = 5"); uc.DefineFunction("Area(length, width) = length * width"); Console.WriteLine(uc.Eval("Area(4, x) + 7"));
#include
#include "uCalc.h"
using namespace std;
using namespace uCalcSoftware;
int main() {
uCalc uc;
uc.DefineVariable("x = 5");
uc.DefineFunction("Area(length, width) = length * width");
cout << uc.Eval("Area(4, x) + 7") << endl;
}
27 #include <iostream> #include "uCalc.h" using namespace std; using namespace uCalcSoftware; int main() { uCalc uc; uc.DefineVariable("x = 5"); uc.DefineFunction("Area(length, width) = length * width"); cout << uc.Eval("Area(4, x) + 7") << endl; }
Imports System
Imports uCalcSoftware
Public Module Program
Public Sub Main()
Dim uc As New uCalc()
uc.DefineVariable("x = 5")
uc.DefineFunction("Area(length, width) = length * width")
Console.WriteLine(uc.Eval("Area(4, x) + 7"))
End Sub
End Module
27 Imports System Imports uCalcSoftware Public Module Program Public Sub Main() Dim uc As New uCalc() uc.DefineVariable("x = 5") uc.DefineFunction("Area(length, width) = length * width") Console.WriteLine(uc.Eval("Area(4, x) + 7")) End Sub End Module