Mooorning....
Here's a reasonably simple question for this time of the morning (well, 08.58 if you live in a sunny december wales!!)
My project is growing day by day, and naturally over the course of time I'm putting routines as seperate routines.
I've done this by selecting "Add New" in the files section and copy-and-pasting from my main code. So far so good.
Because I was doing this, I "THOUGHT" I'd need to use the #include command, but I've a huge amount of problems with this (either this is a bug, or more than likely I've been using it wrong). However, I've learnt that by simply having the file in the Files section, they are automatically appended in the code. Can be frustrating when I get an error on Line 431 and my main code is actually 200 lines, but still, I digress...
The routines I've placed in seperate files are modular, so I can carry them from project to project, but I wanted to know about the variables they use.
For example, I have a parallax starfield, which uses two arrays starX() and starY(). I would have 'liked' these variables to be dedicated to the filename "starfield.dba", but if I place them in there, all elements for the array are set to 0. Placing the array in the main program, and it works.
Whilst I can get it working, it seems a little messy that I have to define all these variables at the start of any project I do.
I also tried putting the arrays in the starfield.dba file, and TRIED to find a way of having these arrays as global, but I can't see any command that allows this (e.g. Global starX(50) )
Please DON'T flame me (like another particular thread here...!) saying that it's a BASIC language, so what can I expect. I would have thought it's a lack of learning on my part, but if it can't be done, or I'm simply going about this wrong, it would be nice to know of any alternatives.
Many thanks...
-----
~ J ~