How do I share procedures and global variables between screens?

I have developed a procedure to show error messages in Screen1. I need the same functionality (showing error messages) in all other screens.

I could copy and paste the code using the Backpack but this is code duplication. If I did that then I would have two or more instances of the same function to maintain and if I found a bug or add a new features in one screen I have to copy and paste the procedure again in all the others.

Is there a way to share procedures and global variables among screens without copying and pasting through the Backpack?

Ciao,
Max

Consider using stacked Vertical Arrangements, one visible at a time, instead of multiple screens.

You can't share global variables or procedures across screens, only TinyDB.

How could it be that MIT forgot implementing a proper way to reuse code...

Consider a different screen to be a different app.

Also, for reusability, you can parametrize your procedures and keep their downloaded block images in a PC folder. They can be dragged into other screens and apps.