using uCalcSoftware;

var uc = new uCalc();
// Define a global format for the 'formattedOutput' parameter
uc.Format("Result = 'Answer: <' + Result + '>'");

// Create a variable and get its memory address
var myDouble = uc.DefineVariable("MyDouble = 123.456");
var ptr = myDouble.ValueAddr();

// 1. Retrieve the value by specifying the data type by name
Console.WriteLine($"By Name: {uc.ValueAt(ptr, "Double")}");

// 2. Retrieve the value using the built-in enum
Console.WriteLine($"By Enum: {uc.ValueAt(ptr, BuiltInType.Float_Double)}");

// 3. Retrieve the value with formatting enabled
Console.WriteLine($"Formatted: {uc.ValueAt(ptr, BuiltInType.Float_Double, true)}");