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:
Retrieves the 8-bit unsigned integer (byte) value associated with a uCalc Item.
Returns the 8-bit unsigned integer (byte) value of the item.
The ValueByte() method retrieves the value of a uCalc Item as an 8-bit unsigned integer (a byte, 0-255).
This accessor is specifically designed for variables that have been defined with the Byte or Integer_8u data type using DefineVariable. While you can call this method on an item of a different numeric type, the value will be cast, which may result in data loss or overflow if the original value is outside the 0-255 range.
This method is the getter counterpart to the setter, ValueByte(byte).
In statically-typed languages like C# or C++, a variable is declared with a fixed type at compile time (e.g., byte myValue = 10;). Accessing it simply involves reading the variable.
uCalc operates at runtime. A uCalc Item is a more flexible container that can hold various data types. The ValueByte() method provides a type-safe way to retrieve the underlying value as a byte, ensuring that the host application receives the data in the expected format. This is part of a family of type-specific accessors (like ValueInt32, ValueDbl, etc.) that provide strong typing within a dynamic environment.