Imports System
Imports uCalcSoftware
Public Module Program
   Public Sub Main()
      Dim uc As New uCalc()
      '// Define a global format for the 'formattedOutput' parameter
      uc.Format("Result = 'Answer: <' + Result + '>'")
      
      '// Create a variable and get its memory address
      Dim myDouble = uc.DefineVariable("MyDouble = 123.456")
      Dim 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)}")
   End Sub
End Module