How do you replace an item in a listview with a particular phrase the press of one button?

I only need the two flip procedures.


P.S. These blocks can be dragged directly into your Blocks Editor workspace.

See A way to group projects by theme - #10 by ABG
for a demo.

Thank you so much, but would this work for the other directions? I plan on including Right, Left, Forward Right, Forward Left, Back Left, Back Right

It's possible to add extra ELSE clauses to the IF/THEN block using the blue Mutator button, turning it into a ladder, with one rung for each of your 6 (?) values and their opposite values.

mutator

These three seem to be causing each other problems can you tell me whats going on?



If you want to flip all possibilities with a single button, you have to combine all the flip combinations into just one procedure with a single long if/then/elseif ladder covering all possible flips.

Otherwise those procedures would conflict with one another if you call more than one of them.

By the way, 'Forward Right' contains 'Right', which may not be what you intended. In that case use text '=' for the comparison, or check for 'Forward Right' earlier in the if/then/elseif ladder than 'Right'.

Once you hit a true test in a long if/then/elseif ladder, you fall off the ladder and skip the other tests.

What would you recommend here?

Swap the first and last branches, so the compound items get tested first.

1 Like

still will not work, right-forward becomes front

Here is a totally different approach.
You may need to tweak the text blocks to match what you actually use as values, because this relies on a complete match in its table lookup approach:


This approach uses a lookup table (a dictionary) of values to replace and replacement values, to feed the replacement process while walking through the list items number by number.

The replacement will use the original value as the replacement value whenever it finds an item it can't find in the keys of the dictionary.

If I missed or misspellled any keys/values in the dictionary of replacements, feel free to fix them.

P.S. These blocks can be dragged directly into your Blocks Editor workspace.

See A way to group projects by theme - #10 by ABG
for a demo.