N00b question about include files:

Blitz3D Forums/Blitz3D Beginners Area/N00b question about include files:

Julian_](Posted 2005) [#1]
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.


big10p(Posted 2005) [#2]
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.


Matty(Posted 2005) [#3]
However any arrays used by the function have to be declared before the function. (I am pretty sure about that)


octothorpe(Posted 2005) [#4]
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.


Julian_](Posted 2005) [#5]
Alright, thanks guys. I got the include files working.


Baystep Productions(Posted 2005) [#6]
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.


octothorpe(Posted 2005) [#7]
Huh?