using uCalcSoftware; var uc = new uCalc(); // This error handler allows you to use variables that were not // explicitly defined previously, by defining the unrecognized identifiers // as variables instead of returning an error static void AutoVariableDef(Handle_uCalc h) { var uc = new uCalc(h); if (uc.Error.Code == ErrorCode.Undefined_Identifier) { uc.DefineVariable(uc.Error.Symbol); uc.Error.Response = ErrorHandlerResponse.Resume; } } uc.Error.AddHandler(AutoVariableDef); Console.WriteLine(uc.Eval("AutoTest = 123")); Console.WriteLine(uc.Eval("AutoTest * 1000"));