Block Codification

Yes...

I'm remarking to you again that you pinged yourself like me in that post...

Okay then...

I'm better than Snap! >:)
image
idea given to me by @oofpaste249 IRL

Uh... Idk what this image is supposed to mean

I used your block to write "when the imposter is sus" in a number only input

Oh! Ok... But you can do this by joining the block with an input.

Btw

Whose codification blocks?

Who is Joe Coolio?

I'm stupid, I said joecooldoo didn't I? I meant yours, sorry

auto correct made me say that. I meant joecooldoo
@scratchmodification

this will not work because the err_try primitive does not work for err_message primaries. Hence, this will still give an error.

I was referring that you can make this shorter:

Result (however, you should add the brackets again to the pages):

image

Alright, its been 2 weeks since I posted this comment, and the project is NO longer on the Featured Column. Thank you all who fixed it. Problem solved!

It should be ["show,default,Looks"]

Yes, I know that. But I'm just saying that the err_try primitive does not work for the err_message primative.

Oh! I know what you mean...

@jens could you add a reporter to get something like err_status?

yeah!

Ok, I've found the solution!


First, copy and import this:

<blocks app="Snap! 7, https://snap.berkeley.edu" version="2"><palette><category name="Block Codification" color="237,28,36,1"/></palette><block-definition s="%&apos;string&apos; as blocks" type="reporter" category="Block Codification"><comment w="127" collapsed="false">Converts the given string (JSON format) to blocks.</comment><header></header><code></code><translations></translations><inputs><input type="%s">["clear,default,Pen"]</input></inputs><script><block s="doIf"><block s="reportNot"><block s="reportIsA"><block var="string"/><l><option>text</option></l></block></block><script><block s="doReport"><block s="reportJoinWords"><list><l>expecting a text but getting a </l><block s="reportTypeOf"><block var="string"/></block></list></block></block></script></block><block s="doIf"><block s="reportListContainsItem"><block s="reportNewList"><list><l>{}</l><l>[]</l></list></block><block var="string"/></block><script><block s="doReport"><block s="reifyReporter"><script></script><list></list></block></block></script></block><block s="doDeclareVariables"><list><l>list</l><l>blocks</l><l>function</l></list></block><block s="doApplyExtension"><l>err_try(cmd, catch, err)</l><list><block s="reifyScript"><script><block s="doSetVar"><l>list</l><block s="reportTextSplit"><block var="string"/><l><option>json</option></l></block></block></script><list></list></block><block s="reifyScript"><script></script><list></list></block><l></l></list></block><block s="doApplyExtension"><l>err_reset</l><list></list></block><block s="doIf"><block s="reportNot"><block s="reportIsA"><block var="list"/><l><option>list</option></l></block></block><script><block s="doReport"><l>Invalid JSON</l></block></script></block><block s="doSetVar"><l>blocks</l><block s="reportConcatenatedLists"><block var="BC data"/></block></block><block s="doSetVar"><l>function</l><block s="reifyReporter"><autolambda><block s="reportIfElse"><block s="reportIsA"><block var="value"/><l><option>list</option></l></block><block s="reportMap"><block var="function"/><block var="value"/></block><block s="reportIfElse"><block s="reportEquals"><block var="index"/><l>1</l></block><block s="evaluate"><block s="reifyScript"><script><block s="doDeclareVariables"><list><l>block</l><l>labels</l><l>inputs</l></list></block><block s="doSetVar"><l>block</l><block s="reportTextSplit"><block var="value"/><l><option>csv</option></l></block></block><block s="doIfElse"><block s="reportIsA"><block s="reportListItem"><l>2</l><block var="block"/></block><l><option>number</option></l></block><script><block s="doSetVar"><l>inputs</l><block s="reportCDR"><block var="block"/></block></block><block s="doSetVar"><l>block</l><block s="reportListItem"><l>1</l><block var="block"/></block></block><block s="doSetVar"><l>labels</l><block s="reportAtomicKeep"><block s="reifyPredicate"><autolambda><block s="reportAnd"><block s="reportGreaterThan"><block s="reportStringSize"><l></l></block><l>1</l></block><block s="reportEquals"><block s="reportLetter"><l>1</l><l></l></block><l>%</l></block></block></autolambda><list></list></block><block s="reportTextSplit"><block s="reportListItem"><l>1</l><block s="reportTextSplit"><block var="block"/><l><option>csv</option></l></block></block><l> </l></block></block></block></script><script><block s="doSetVar"><l>labels</l><block s="reportAtomicKeep"><block s="reifyPredicate"><autolambda><block s="reportAnd"><block s="reportGreaterThan"><block s="reportStringSize"><l></l></block><l>1</l></block><block s="reportEquals"><block s="reportLetter"><l>1</l><l></l></block><l>%</l></block></block></autolambda><list></list></block><block s="reportTextSplit"><block s="reportListItem"><l>1</l><block var="block"/></block><l> </l></block></block></block><block s="doSetVar"><l>block</l><block s="reportListAttribute"><l><option>csv</option></l><block var="block"/></block></block><block s="doSetVar"><l>inputs</l><block s="reportNewList"><list></list></block></block></script></block><block s="doSetVar"><l>block</l><block s="reportAtomicFindFirst"><block s="reifyPredicate"><autolambda><block s="reportEquals"><block s="reportListItem"><l>2</l><l/></block><block var="block"/></block></autolambda><list></list></block><block var="blocks"/></block></block><block s="doIfElse"><block s="reportEquals"><block var="block"/><l></l></block><script><block s="doStopThis"><l><option>this block</option></l></block></script><script><block s="doSetVar"><l>block</l><block s="reportIfElse"><block s="reportEquals"><block s="reportListItem"><l>1</l><block var="block"/></block><block s="reifyReporter"><autolambda><block s="reifyReporter"><autolambda><block s="errorObsolete"></block></autolambda><list></list></block></autolambda><list></list></block></block><block s="reifyReporter"><autolambda><block s="errorObsolete"></block></autolambda><list></list></block><block s="reportListItem"><l>1</l><block var="block"/></block></block></block></script></block><block s="doIfElse"><block s="reportListIsEmpty"><block var="inputs"/></block><script><block s="doReport"><block var="block"/></block></script><script><block s="doDeclareVariables"><list><l>list</l><l>label</l></list></block><block s="doSetVar"><l>list</l><block s="reportNewList"><list></list></block></block><block s="doSetVar"><l>label</l><l>1</l></block><block s="doForEach"><l>item</l><block var="labels"/><script><block s="doAddToList"><l></l><block var="list"/></block><block s="doIf"><block s="reportOr"><block s="reportListContainsItem"><block s="reportNewList"><list><l>%receive</l><l>%inputs</l><l>%send</l><l>%ringparms</l><l>%sum</l><l>%product</l><l>%min</l><l>%max</l><l>%words</l><l>%scriptVars</l><l>%exp</l><l>%lists</l><l>%nums</l></list></block><block var="item"/></block><block s="reportGreaterThan"><block s="reportListAttribute"><l><option>length</option></l><block s="reportTextSplit"><block var="item"/><l>%mult</l></block></block><l>1</l></block></block><script><block s="doReplaceInList"><l><option>last</option></l><block var="list"/><block s="reportNewList"><list><block s="reportListItem"><block var="label"/><block var="inputs"/></block></list></block></block><block s="doChangeVar"><l>label</l><l>1</l></block></script></block></script></block><block s="doReport"><block s="reportJoinWords"><block s="reportCONS"><block var="block"/><block var="list"/></block></block></block></script></block></script><list></list></block><list></list></block><block var="value"/></block></block></autolambda><list><l>value</l><l>index</l></list></block></block><block s="doWarp"><script><block s="doReport"><block s="reportJoinWords"><block s="reportMap"><block var="function"/><block var="list"/></block></block></block></script></block></script></block-definition></blocks>

Then to implement it in your project, just do this:

Before I saw this, I did something else. I made it so instead of giving an error, the block reports invalid json, and put this script in my block
image

Ok, but using many is not good, since it takes a delay to convert the blocks. The script I gave you is the best option because it only converts the block once.

okay...

That can easily be improved:

  1. REPORT NOT <<IS ...> OR <...>>
  2. Have one script variable set to BLOCK AS BLOCKS