Include filename  

Definition:

Includes more Blitz Basic source code into your code from an external file.

Parameter Description:


filename = full path and filename of your .bb include code

Command Description:

Includes are a cheap substitute for Function Folding (grin). Seriously, Includes offers the programmer a means of keeping distinct code seperate by taking 'working' subroutines, functions, variable assignments - heck, ANY code and placing it into an external .bb file. This external file can be 'included' into another Blitz program - and when you run the program, Blitz will 'included' that external code just as if it cut and pasted it right into your source code before it runs. For example, you could create a small Blitz program for displaying your 'intro' screen/effect and save it off as 'intro.bb'. Then, give it to all your programmers so they can 'include' that source code at the beginning of their game. Many programmers find it useful to write functions, test them, and once working 100% properly, save them off as their own source code and just include them in their main program. This keeps code segregated, readable, and modularly changeable.

For debugging purposes, if you run a program with included files, and one of the includes has an error, Blitz will automagically load the include, and display the error/debug information there. Nice, huh?

Hopefully Function Folding will be supported in future versions of Blitz, since many people use Includes to 'simulate' this feature.

Note: The example only shows you the calling code using the INCLUDE command - it will not run unless you create the included files yourself.

Example:

; INCLUDE Example

; Include the source code that has all our variables in it
Include "myvariables.bb"

; Get the TYPEs from an external source code include
Include "myTYPES.bb"

Index