Multiple tabs and namespaces

When you have a project with multiple tabs, the IDE performs some magic and merges all the files together, I do not know the exact details, however all the global declarations are "seen" by any file, regardless its name/loading order.

In order to keep things separate in the global scope, I use namespaces.

However, unlike global declarationbs, namespaces cannot be seen by files earlier in the loading order. Then the order matters, and for circular dependencies there are no easy solutions.

Is there a way to have namespaces and still be able to reference them from any file in my project?

When you have a project with multiple tabs, the IDE performs some magic and merges all the files together

That depends on the extensions associated with the files in each tab. You should avoid making blanket statements like this until you understand what the IDE is doing, and why it does it.

however all the global declarations are "seen" by any file, regardless its name/loading order.

This, for example, in not necessarily true.

Is there a way to have namespaces and still be able to reference them from any file in my project?

By the time namespaces matter, you should be creating and using libraries, not trying to build everything in one program. Then, you'd likely not need namespaces.

You spent most of your reply trying to nitpick and the rest asking me to do something completely different from what I am doing.

You have provided 0 explanation about anything at all, most importantly namespaces.

In other words you simply replied just to bitch. Bad hair day today, PMT, or what ?

You spent most of your reply trying to nitpick and the rest asking me to do something completely different from what I am doing.

So? There are reasonable ways to accomplish your goal, and there might be unreasonable ways. It seems to me more important for you to tell us what extensions you are using, to post some code, and to consider whether your way is the right way way, than for me to help you do something one way, blindly, that is nowhere near the best way.

Given your attitude, though, I don't think I'll be posting in this thread again.

When you have several .ino files in a project the compiler loads the main project file first and then loads the other files in alphabetical order. Global variables in a file are visible to files loaded later than it, but are not visible in files that were loaded before it.

I find it hard to imagine how one could have so many variables in an Arduino program that different namespaces are necessary to keep track of them. Why not just devise some naming conventions.

...R