/
krasninja
/
querycat
Обзор
Документация
Войти
/
krasninja
/
querycat
Код
Пакеты
0
Релизы
0
Аналитика
Безопасность
develop
src/QueryCat.Samples/Collection/VariablesUsage.cs
18 строк
554 B
Ivan Kozhin
Update samples, fix dict key type problem
06 май 2024, 15:00
06 май 2024, 15:00
2b81d9b
Код
Авторство
О чём код?
using QueryCat.Backend; using QueryCat.Backend.Core.Types; namespace QueryCat.Samples.Collection; internal class VariablesUsage : BaseUsage { /// <inheritdoc /> public override void Run() { var executionThread = new ExecutionThreadBootstrapper().Create(); // Define variable in script. executionThread.Run("declare x int := 10;"); // Define variable in code. executionThread.TopScope.Variables["y"] = new VariantValue(5); Console.WriteLine(executionThread.Run("x+y").AsString); // 15 } }