Hello all. I am not a novice to programming, but neither am I an expert! However, I am new to Dark BASIC Pro.
I have a number of questions related to how the DBPro IDE and System works, and would like to know where I can find more infomration about this.
For example: 'Included' Files.
I notice that a DBPRO 'Program' can Include a number of (Project) Files (.dba's). I also note that the Project File (.dbproj) can be edited with a Text Editor, so you can make changed manually as well.
What I am not clear about is 'how' DBPro handles the processing of 'Included' Files.
How does it Compile them? Instructions are normally processed sequentially (line by line) unless there are any 'Jumps' (GOTO/GOSUB/Functions/etc), so how does DBPro handle the Inclusion of other .dba Files?
I presume the 'Main File' is always loaded first. Does DBPro just then 'Append' any Included Files and if so, how does it decide which order to append them? If it does not append them, what does it do?
For example, if I were to create a Main File (MAIN.dba) with the Statement:
Print "Hello World"
and then add another File (INCLUDE.dba) with the Statement:
Print "Goodbye World"
I presume you will get 'Hello World' followed by 'Goodbye World'.
Now, if I wanted to keep that the same, but have DBPro reverse the order it was printed, how would I do that: Put a Label in each File and jump to the label to change the order? i.e.
MAIN.dba
--------
GOTO GoodbyeWorld
HelloWorld:
PRINT "Hello World"
INCLUDE.dba
-----------
GoodbyeWorld:
PRINT "Goodbye World"
GOTO Helloworld
Would that work? (I am not offering that as good practice, just an illustration
)
Furthermore, If I were to have a Function in the Main File, and another Function in the Included File, can they be called one from the other?
The reasons I am looking to understand this better is to decide how I may structure any programs I may create, and how the use of Included Files can contribute to the structuring, and what does, and doesn't work.
Short of just hacking away on the 'suck it and see' principle, or digging through reams of other peoples Code to try and glean such intelligence, where can I find useful and illuminative information about how Dark BASIC Pro handles these and related things.
The Help/Tutorials do not (seem to) cover such topics as these...
Thanks,
Chris.
btw, I like the look of DBPro for game focused developments, and hope to spend some time with it.