! Baxslash! You've just solved one of my work flow issues!
I've been dumping my functions into individual DBA files, then referencing each DBA file to the project. Problem being though, I couldn't host the Dim Array or Dim Type stuff that each function would manipulate, meaning that my DBA library wouldn't be a "complete" package as such, requiring all the Dim's that each function was using to be made in the main DBA file.
BUT NOW, I've just realised I can create a DBA file, have a "Go Sub" for the first half of the file, where all the specific arrays are dimensioned, then, the function part follows after the sub routine ends. This results in a bunch of "Go Subs" being called prior to my game loop, rather than all the messy dimming code.
I think this will work. I'm gonna try it now!
Fingers crossed it all works!
EDIT: Damn it, doesn't totally work.
I can get this working;
Sub_Mouse:
Type tMouse
Cursor as Integer
CaptureX as Integer
CaptureY as Integer
CaptureZ as Integer
CaptureX_Held as Integer
CaptureY_Held as Integer
CaptureZ_Held as Integer
Scroll as Integer
Scroll_Held as Float
ScrollSpeed as Float
EndType
Return
End
But not this;
Sub_Mouse:
Type tMouse
Cursor as Integer
CaptureX as Integer
CaptureY as Integer
CaptureZ as Integer
CaptureX_Held as Integer
CaptureY_Held as Integer
CaptureZ_Held as Integer
Scroll as Integer
Scroll_Held as Float
ScrollSpeed as Float
EndType
Mouse as tMouse
Mouse.CaptureX = 0
Mouse.CaptureY = 0
Return
End
EDIT AGAIN!: Woo! Problem solved by using sticking a Global infront of everything.
Sub_Mouse:
Type tMouse
Cursor as Integer
CaptureX as Integer
CaptureY as Integer
CaptureZ as Integer
CaptureX_Held as Integer
CaptureY_Held as Integer
CaptureZ_Held as Integer
Scroll as Integer
Scroll_Held as Float
ScrollSpeed as Float
EndType
Global Mouse as tMouse
Return
End
EDIT AGAIN:
ZOMG THIS IS THE BEST WAY TO CODE EVER! EVERYTHING IS SO ORGANISED, IT'S AWESOME!!!!!!!
Ehem. So. I wonder if my adventures put this long debated topic to rest. With both the power of functions and go subs, you can achieve anything!
Help build an online DarkBASIC Professional help archive.
[href= http://dbprohelp.wikia.com/wiki/DarkBASIC_Professional_Help_Wiki]DarkBasic Help Wikia[/href]