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:
Re-points a host-bound (proxy) variable to a new memory address at runtime.
This method does not return a value.
This method re-points a host-bound uCalc variable to a new memory address in the host application. It is the setter for the ValueAddr() property and is a powerful tool for low-level memory integration.
This method applies only to variables that were created as proxies for data in your host application. A proxy variable is created by passing a memory address to uCalc.DefineVariable():
// Binds 'ucVar' to the memory location of 'hostVar'
var ucVar = uc.DefineVariable("myVar", AddressOf(hostVar));
In this state, ucVar does not have its own storage within uCalc; it is simply a named reference to an external memory location.
ValueAddr() vs. Value()It is crucial to understand the difference between this method and the Item.Value() setter:
item.Value(newValue): This changes the data at the currently pointed-to memory address. It modifies the value of the host variable.item.ValueAddr(newAddress): This changes the address itself. It makes the uCalc variable stop pointing to the old host variable and start pointing to a new one.vs. C++ Pointers: This behavior is directly analogous to reassigning a pointer in C++.
int a = 10, b = 99;int* p = &a; // p points to ap = &b; // Now p points to b. This is what ValueAddr() does.vs. C# References: In safe C#, you cannot easily "re-seat" a reference (ref) variable to point to a different memory location after it has been initialized. uCalc's ValueAddr() provides a level of dynamic, low-level control that is typically only available in unsafe or unmanaged code, making it a powerful feature for high-performance integrations.