Imports System
Imports uCalcSoftware
Public Module Program
   Public Sub Main()
      Dim uc As New uCalc()
      '// Define a variable 'x' that will be updated in the loop.
      Dim variableX = uc.DefineVariable("x")
      
      '// Parse the expression just once before the loop begins.
      Dim parsedExpr = uc.Parse("x^2 * 10")
      
      Console.WriteLine("Evaluating 'x^2 * 10' for x = 1 to 5:")
      For x  As Double = 1 To 5
         variableX.Value(x)
         '// Evaluate is very fast as the parsing work is already done.
         Console.WriteLine($"x = {x}, Result = {parsedExpr.Evaluate()}")
      Next
   End Sub
End Module