Why don't we have EACH?

BlitzMax Forums/BlitzMax Programming/Why don't we have EACH?

Well I see your point on 2, but I don't get what the benefit of 1 is. With an include you get effectively the same thing, if I understand correctly. It doesn't really matter if the main program can "see" the code in the functions or not if it can't access them.

Can an imported file access globals in your main program? Perhaps that is the difference.

If I have a function in an include like so:

Function blah()
For Loop = 1 to 10
next
Next

And the main program has a Global called Loop, then with the Include, the global will be modified by the function, because the function will assume Loop is the global variable.

But maybe with imports that doesn't happen? How could it? The file is compiled seperately and ahead of time, so how could it know it will need to access a global?

That would mean you can't access globals in your main program from an import, but you can access them from an include. I'm not sure you'd want to do that, but that would be an important difference.