N00b question about include files:
Blitz3D Forums/Blitz3D Beginners Area/N00b question about include files:
| ||
I was just wondering if it's okay to put functions into include files. According to my bible, I should always put functions after the main loop, and if I use an include it'll put it, technically, at the start, right? I should try but I'd rather ask questions. |
| ||
Functions don't have to go after your main loop - they can go anywhere. When specifying an include file, it's simply the equivalent of copying all the code in that file, and pasting it at the point you have you're include command. |
| ||
However any arrays used by the function have to be declared before the function. (I am pretty sure about that) |
| ||
What works for me is: Constants Types Globals Includes Functions In true C style, my main loop goes in a function called main(), which I call a line before the function definition. |
| ||
Alright, thanks guys. I got the include files working. |
| ||
Nope, all includes. Includes for functions Includes for Constants Includes for Types Includes for Engines Includes for Variables. That way it's easier to reuse codes. |
| ||
Huh? |