Find replace function

Well ... with a restriction: apparently you can't have a reporter and a command with the same name and the same input slots (under penalty of an unwanted "(2)" postfix).

Seeing your point, though, I made one of the inputs a multiline, which automatically changes the type from "any" to "text" but without visibly widening the input slot:

Find and replace code script pic (36) Find and replace code script pic (38)

Find and replace code script pic (37) Find and replace code script pic (39)

Huh. You learn something every day. Thanks!

Hey there! I actually have a request
Would it be possible to make a system that replaces instances of custom blocks inside a script with that custom block’s definition?

For straightforward functions it’s feasible, I guess. It’s going to be quite difficult for functions with unevaluated or ‘multiple’ inputs, or upvars.

I think that reports a ring that has input names selected

Those could be done later

This should be doable with the metaprogramming features -- after all, it's what Snap! does when you call the block.

But it'd be much easier if you decide to do that ahead of time, so you can write the block as a macro in the first place.

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