Multiple substitution in blocs

Hi all,
Is ther anyway to make a multiple substitution in blocs ?
I have a ~6300 blocs screen and in several labels I have introduced a backgroud color that may vary between no color and green color according to several facts.
The green color is a RGB color: 28,86,49, and at this moment I would like to test other colors. I have the label backgroud color instruction 104 times in blocs, so it is very difficult, first to search for all instructions and then to modify them.
I don't know if it is possible to make a multiple substitution in blocs (for instance, 28,86,49 to 49,34,37). Any help ???
Thanks in any case.

Post a simple test aia that only affects this aspect,
(and also the blocks).

Perhaps some code like this

This is the screen

. You can see the green background.

This is the blocs instructions. There are 104 in 6300 blocs.

Is there anyway to replace all instead one per one ???

Not possible to do this, because background color varies during program execution. It represents the player that serves the ball. I want to test different colors, but without replacing all one per one, if possible.

see my edit ...

then you would have to use a Clock event handler to periodically change the values perhaps

Thanks Steve,
I only want to change one label corresponding to the table tennis player that has to serve the ball. At each 2 serves the player changes.
I would like to check different color but without replacing one per one as, for instance, if you want to replace a text in a word document.

Hide the color choices in value procedures. Search this board for Wordle in a Day.

Adapt the code I posted to do what you want using conditional statements. Did you try the example?

I think the code , with a few changes, is what you hope to do. :cry:

Another possibility would be to edit the Screen1.bky file

Always remember to make backup copies of your .aia files

This is a good idea but I am not sure that it will function as I want; I can find the RGB color (28,86,49) in bky file but not one beside the other. The 3 values are separated with a lot of text in the middle. So, I could replace «28» for «XX» for instance, but how can I be sure that there aren't others texts that include «28» and that will be also replaced ?
It is a good idea but the RGB value organization in not so good as I want.
Thanks in any case !!

Set the list like this...

or better change it from the code blocks...

Look for FAQ Blocks Editor in this forum..
There is a browser extension that gives you a search capability.

THis is what I can read


I am not very sure that I could replace for instance "NUM">28 by "NUM">XX and that this only will affect the color and not another part of the program....

I have 6300 blocks and 104 colors to change....This could be an appinventor version of Where's Wally

When you have too many blocks spread out over too large a surface area,
the Blocks Editor hits a complexity limit when it tries to generate a blocks.png file for the screen.

There are two main approaches to deal with this:

  • Start a Google Doc with a Table of Contents explaining your app, with sections for Design, Data, Code, including Downloaded Png images of all Events, Procedures, Globals, and with html cross-links for easy navigation. Such a doc becomes easier to read than a complete blocks image, because you have FIND, Next, PREV, back functionality, and you can add paragraphs of commentary around your code. This is my preferred life saver when doing a very large complex app. If you go this route, try to arrange your blocks geographically in a column matching the order of your Table of Contents, then do periodic Clean Up Blocks to pull them inline. This sometimes lowers the load on the Blocks Editor.
  • Reduce your block count:
    • Use parametrized procedures for common code
    • Use Media text files instead of big clumps of text blocks
    • Use generic blocks instead of repeating component event blocks
    • Encode repeating decision patterns into lookup tables loaded from Media csv text files (does your blocks image look like a box of combs?)

Have you read my two previous posts?

Can you change your code with the "list from csv row" block?

Do you know how to use "Replace All" with Notepad++?