From 2d9ce052d6f1e8ad486fc6ded8c812424b45acaa Mon Sep 17 00:00:00 2001 From: Nadine Martin Date: Sat, 9 Mar 2024 12:17:26 +0000 Subject: [PATCH] got out working for values in int and enum domain --- src/index.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/index.js b/src/index.js index da0ecd2..1c736c2 100644 --- a/src/index.js +++ b/src/index.js @@ -187,7 +187,7 @@ async function getSolution() { blockOut.createVariable(v); let varBlock = blockOut.newBlock('variables_set'); varBlock.setFieldValue(blockOut.getVariable(v).getId(), 'VAR'); - console.log(typeof(sol[v])); + //console.log(typeof(sol[v])); let valueBlock; switch (typeof(sol[v])){ case("bigint"): @@ -196,9 +196,10 @@ async function getSolution() { valueBlock.setFieldValue(sol[v], "NUM"); break; } - case("object"): { + case("string"): { console.log("enum"); - valueBlock = null; + valueBlock = blockOut.newBlock('text'); + valueBlock.setFieldValue(sol[v], "TEXT"); break; } default:{