Includes and Excludes

Blitz3D Forums/Blitz3D Beginners Area/Includes and Excludes

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

I believe you are using Include incorrectly. When you "Include" a file, you are basically putting the source where the include is. So do something like this:
;Main.bb
Include "Menu.bb"
Graphics 800,600
While Not KeyHit(1)
If KeyHit(MENU_KEY)
 a = Menu()
 Print "You Pressed " + a
Wend
End

;Menu.bb
Const MENU_KEY = 59

Function Menu()
Repeat
Print "1) Do Nothing"
Print "2) Don't do anything"
Print "3) Nothing done here"

a = Input("Your Choice? "
Until a > 0 And a < 4
Return a
End Function

Then you compile Main.bb. The compiler, when it compiles will see Main.bb as though you had written everything into one source code like so:
;Main.bb
;Menu.bb
Const MENU_KEY = 59

Function Menu()
Repeat
Print "1) Do Nothing"
Print "2) Don't do anything"
Print "3) Nothing done here"

a = Input("Your Choice? "
Until a > 0 And a < 4
Return a
End Function
Graphics 800,600
While Not KeyHit(1)
If KeyHit(MENU_KEY)
 a = Menu()
 Print "You Pressed " + a
Wend
End

Inserting Menu.bb right where the "Include" was in Main.bb