# Looking for a node +parser error

**URL:** <https://forum.xod.io/t/looking-for-a-node-parser-error/6619>\
**Category:** XOD Programming Questions\
**Created:** [August 9, 2023, 9:16pm UTC](https://forum.xod.io/t/looking-for-a-node-parser-error/6619 "2023-08-09T21:16:23Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![bartex](https://avatars.discourse-cdn.com/v4/letter/b/848f3c/32.png) [@bartex](https://forum.xod.io/u/bartex)\
**Post date:** [August 9, 2023, 9:16pm UTC](https://forum.xod.io/t/looking-for-a-node-parser-error/6619/1 "2023-08-09T21:16:23Z")

</div>

Hello.  
I’m used to visual programming, but C++ is hard to me…  
XOD was the best _translation_ that I found.  
It was quite hard to start XOD, due to lack of basic _blocks_ (nodes), but I already figured it all out.

Now I’m looking for a node, that basically does not exist and seem hard to implement to me… but looks easy to do in mind: I want to have something like self-expanding node.  
Sounds a bit like standard _variadic_, but it’s slightly different: what I want it to be, is that a number will tell the node how wide it should be (just like variadic, but going itself, depends on a given number).  
By that, a user may -for example- just write how many sides the figure would be, and then write them (like in the string) - the program will process it, and make some calculations depending on -for egz.- the count of sides, and decision which figure is that (triangle, square, etc).  
The problem would also be: how to make connections to all IN-pins, when extended…

It may be also a kind of variadic, but made for not only inputs, but also outputs (like copying the code 1:1)… or a kind of a _copy-block_, which will copy its insides&pins for the given number of times.

I don’t deny that I wanted to make a _storage-shelf_ in this way also (like: store data in gate-res; then choose the number of gate to send out data [by adding all outputs])… but it would need a variadic pin counter, whis is linked to each gate somehow. I already have a gate-res node (gate, but if False, it sends out 0), but I was stopped there.  
\*by the way: why variadic stops me from putting one bool+one number IN’s, and one number OUT…?  
I wanted to make a kind of variadic gate, but it didn’t agree…

I saw some array libraries made by some of you, and it would be also good - but I wanted something self-expanding. Only string-data operations are possible…?

* * *

Like:  
I may create string-input, add couter of values into it, and then the program may begin working…

**UPDATE:**  
Well, I tried.  
I copied the “constant-string” box from the Tutorial project, and made on this example a _saving_-part of the _magazine_, for exactly 4 elements: it takes number values, processes them (with added _counter_ - for the order), and _format-number_ node; all using concat - and so the _fake-json_ output was based on string - so it looks just like in the given example, but made for 4 numbers +1 word as a type option (I want to make 2 of them for 2 different things). Output from this _saving_-part is (4 egz.) this: **{“boki”: [42.27, 162.40, 184.20, 0]}**. It looks fine.

Then, I made next code-node to unpack it [and here I have an official **Error**]:

1. _buffer_, to _freeze_ that string in time during _reading_
2. _stream-string_, to make it in byte
3. _parse-json_, to make it readable within an order
4. _key_ to find if it’s my word
5. _nth_ and _number value_ to read those numbers.

…and it all looks great; it even reads[**!**] _constant-string_ nodes filled with it (even my string), when pinned directly to _stream-string_, **BUT** …  
Part 3 - parser got errors each time I’m using additional 1 concat to add even 1 **right symbol** to the end of a string.  
I mean: even if I copy the original text **{“name”: “Peter”, “age”: 20, “pets”: [“turtle”, “snail”]** and add just one remaining **}** to the end with _concat_ - the parser immediately strikes with an error, stopping all next nodes from reading.  
I thought it may be because it’s somehow programmed to read constant strings, but… why it isn’t working when it gets a string that is constant during reading…?  
How to make it work, _finally_…?

\*and I’m still thinking about that second _magazine_, with numbers that may be added without a limit… but I’m quite confused even here, so I stopped at this one.

If someone knows how to solve it…?

PS.: Thanks **A LOT** in advance!!

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex027/uploads/xod/original/1X/eb7348baa04192c2ef932d1db54d44f09f8a7888.png) [@system](https://forum.xod.io/u/system)\
**Post date:** [September 8, 2023, 9:17pm UTC](https://forum.xod.io/t/looking-for-a-node-parser-error/6619/2 "2023-09-08T21:17:09Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
