I have a dba file in my project that contains a function that creates all my global variables. I call this function at the start of my program, and my variables are all available to me with the right values.
However, when I create a type in my globals file, it doesn't seem to work as I expect. I get the error: cannot find field 'x'
code from globals.dba
type vectortype
x as float
z as float
endtype
global gComV as vectortype
gComV.x=0
gComV.z=0
code from main.dba
gComV.x=sin(gRotation#)*gAccel#
gComV.z=cos(gRotation#)*gAccel#
If I move all of the type declaration stuff into main.dba it works as expected, but obviously my code becomes a right mess. If I can move this kind of thing out to a seperate source file, it'd make my life easier.
So is there a way to get types working globally?
[edit -> just noticed a typo in the code, but it doesn't affect the problem