#include <iostream>
#include "uCalc.h"

using namespace std;
using namespace uCalcSoftware;

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

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

   // 1. Retrieve the value by specifying the data type by name
   cout << "By Name: " << uc.ValueAt(ptr, "Double") << endl;

   // 2. Retrieve the value using the built-in enum
   cout << "By Enum: " << uc.ValueAt(ptr, BuiltInType::Float_Double) << endl;

   // 3. Retrieve the value with formatting enabled
   cout << "Formatted: " << uc.ValueAt(ptr, BuiltInType::Float_Double, true) << endl;
}