Imports System
Imports uCalcSoftware
Public Module Program
   Public Sub Main()
      Dim uc As New uCalc()
      '// Create two independent uCalc instances
      Dim uc1 As New uCalc()
      Dim uc2 As New uCalc()
      
      '// Define a variable 'x' in each instance with a different value
      Dim itemX1 = uc1.DefineVariable("x = 100")
      Dim itemX2 = uc2.DefineVariable("x = 200")
      
      '// Use the item to get its parent context and evaluate 'x * 2'
      '// This correctly uses uc1's context where x is 100.
      Console.WriteLine($"Context 1: {itemX1.uCalc.Eval("x * 2")}")
      
      '// This correctly uses uc2's context where x is 200.
      Console.WriteLine($"Context 2: {itemX2.uCalc.Eval("x * 2")}")
      
      '// Clean up the instances
      uc1.Release()
      uc2.Release()
   End Sub
End Module