12.07.2011, 20:19
Hi
As I am currently developing a big modular project I encountered a problem. The situation is the following:
I got a load of includes that all for themselves provide specific features. Some of the includes depend on the functions or variables of other includes. Normally this can be solved by loading the depending include after the needed include, but now I ran into an ugly circle, so include A needs include B, and include B needs include A, so this cant be solved by including A before B or the other way round.
As we all know (at least I hope so), for functions there is the forward keyword that makes function "accessable from any position", but this just works for functions, not for variables.
I already thought about creating headerfiles for each include that just contain all the variables, and are loaded at the very beginning. This is a common solution, as it is popular in other languages, but I wouldnt like to do it, if there was another solution, as I use the standard PAWNO editor, and already got enough windows opened, and I really wouldnt like to double these windows
So again my question in short: Is there a way to "forward" variables to make them useable before they are created in the script?
Im not asking questions here often, but reading and searching didnt help, so I doubt there is a way, but asking cant harm. I would really appreciate if anyone had an answer for this problem.
As I am currently developing a big modular project I encountered a problem. The situation is the following:
I got a load of includes that all for themselves provide specific features. Some of the includes depend on the functions or variables of other includes. Normally this can be solved by loading the depending include after the needed include, but now I ran into an ugly circle, so include A needs include B, and include B needs include A, so this cant be solved by including A before B or the other way round.
As we all know (at least I hope so), for functions there is the forward keyword that makes function "accessable from any position", but this just works for functions, not for variables.
I already thought about creating headerfiles for each include that just contain all the variables, and are loaded at the very beginning. This is a common solution, as it is popular in other languages, but I wouldnt like to do it, if there was another solution, as I use the standard PAWNO editor, and already got enough windows opened, and I really wouldnt like to double these windows
So again my question in short: Is there a way to "forward" variables to make them useable before they are created in the script?
Im not asking questions here often, but reading and searching didnt help, so I doubt there is a way, but asking cant harm. I would really appreciate if anyone had an answer for this problem.