Disable JSON Fanciness

Recently in Snap! 9.0, I've noticed that JSON strings are printed fancily (with indents and whatnot) to improve readability. Is there any way to disable this?

Moon Landing Sim 3 + Multiplayer + Lasers script pic

(I just want it to return [0,0,0] without indents).

that does slightly fix it, but it is still left with the multiple spaces (which is part of what im trying to disable)


(Side note, 100th untitled script pic)

this is good for numbers, but deletes spaces in strings in the json.
fortunately, all i'm using this for is for numbers i'm pretty sure. so it works fine.
thanks!

(also, congrats on your 100th untitled script pic! lol)

Yeah something I’ve tend to noticed with text is the “split by” is also just “remove” if you join them
You should be able to use combine if you want to keep the spaces instead of just join

COMBINE is for lists. JOIN more or less is the equivalent for strings.

You can create a recursive custom block to create a JSON list.


(You can drag and drop this image into the editor to import the block; if it doesn't work, click on the image to blow it up and try dragging that)

Once Snap! 10 comes out, you can program the default [JSON] OF [] block to do this.

untitled script pic (3)

Supports 1D, 2D, 3D, etc. lists, text, booleans, and numbers, just like the [JSON] OF [] block.
Also escapes any character that will unintentionally alter the JSON.
Essentially the same thing without the formatting.

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