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:
Sets the value of a uCalc variable to a specified 64-bit integer.
This method does not return a value.
The ValueInt64 method provides a direct and type-safe way to set the value of a uCalc variable that holds a 64-bit integer. It is the primary setter for variables defined as Int64 or Long.
This method is used after a variable has been created with a method like DefineVariable. It allows the host application to update the variable's state before an expression is evaluated, which is crucial for performance.
csharp
// 1. Define a 64-bit integer variable for a database record ID
var recordId = uc.DefineVariable("recordId As Int64");
// 2. Set its value using ValueInt64
recordId.ValueInt64(8192837123981273);
// 3. Use it in an expression
Console.WriteLine(uc.EvalStr("recordId")); // Outputs: 8192837123981273
This method handles both signed (Int64) and unsigned (Int64u) variables correctly. When setting an unsigned variable, the bit pattern is preserved. For example, setting an Int64u variable to -1 will result in its maximum possible value, 18446744073709551615.
There are three primary ways to manage variable values in uCalc, each with different performance characteristics.
ValueInt64 (Type-Safe Setter - Recommended)
Value(string) (Expression-Based Setter)
Direct Memory Binding (Highest Performance)
DefineVariable, you can pass a pointer to a host application variable. The uCalc variable becomes a direct proxy to your native variable, eliminating the need for any setter calls.In summary, ValueInt64 offers the best balance of performance, safety, and ease of use for programmatically updating 64-bit integer variables.