Code that works in one project but not in another

Hi,
I made a test code to convert a string into a list. In my test project, it works, but in my main project, it doesn't. I cloned my main project, I removed all the other elements that could interfere.

My main project is now virtually identical to my test project, and it still doesn't work...


Working test project:


Main project (from which I've removed everything except the crux of the problem)


I don't understand why I get letters separated by spaces between parenthesis instead of a list, as in the test project...

You fell victim to the Blocks Editor automatic trimming of blanks from text blocks.

Go back into that blank looking text block and insert a blank into it.

If I put a space in the empty text block in front of "at", I still get the same bug.

In my functional code, this box is empty.
When I don't use any characters, the only difference is that the letters between the parentheses (which should be square brackets) are separated by spaces. But the bug persists.

Were you able to reproduce the bug with my .aia file?

Try the split at spaces block from the text drawer
Taifun

Project properties ---general --- show json as list, tick it

You appear to have "doubled down" on your blocks:

This is all you need:

image

Ensure as advised above that you check the UseListsAsJson checkbox in Project Properties

The bug remains

does_not_work (1).aia (32.4 KB)

Here is a draggable blank text block.

You know it is non-empty if you can wiggle the cursor inside it.
Alternatively, take the text length block on it and see what comes back, 0 or 1.

text

Nothing to do... The bug remains.
Do you have the same problem with my .aia file?

text2list.aia

Splitting any text at an empty (zero length) text will break it up into a list of single characters, give or take a leading empty item.

Splitting at the blank (%20) character will give you a list of words.

That is the expected behavior in each case.

How is what you are getting different from that?

If you are in doubt as to what is in your text block, take its length using the text length block.

Everything looks as expected in your sample.
Splitting a text at something that isn't in it (a blank) returns a list with a single item, the original text.

texte2list-2.aia

Sure it's empty...

Turn on that JSON flag suggested earlier in this thread. The old parentheses display does not help debug.

All right!
I finally get the list syntax!!!!

The form in parentheses or as a list with square brackets, quotation marks and commas is important when I ask a TTS to read the variable...

Huge thanks to you!!! :handshake:

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