you
CAN #include files that declare their own data, i do it all the time as I
LOVE self declaring modules!
For example, I'll declare a function like this...
`***Main.agc***
#include "MadeUpFile.agc"
Do
MadeUpFunction()
Sync()
Loop
End
`***MadeUpFile.agc***
Type tTypeArray
Something$
EndType
Global Initialised = 0
Function InitialiseMadeUpFunction()
Global TypeArray As tTypeArray[ 10 ] : ` NOTE, we don't need to use Dim any more.
TypeArray[ 0 ].Something$ = "Yes!"
Initialised = 1
EndFunction
Function MadeUpFunction()
If Initialised = 0 Then InitialiseMadeUpFunction()
Print( "Is Mobiius a legend? " + TypeArray[ 0 ].Something$ )
EndFunction
Global Variable = 5 will work at the top of an included file without being executed past, Dimming variables HAS to be executed, so needs to be within a function. (
DIM has been depreciated in favour of the new style of declaring variables, as I've used in my snippit.
)