Including files other than .bmx

BlitzMax Forums/BlitzMax Programming/Including files other than .bmx

JoshK(Posted 2007) [#1]
I am working with BVM2, and I have the script running just like BlitzMax code. It would be a lot easier if I could include a .script file in a BlitzMax program, in order to test scripts as real BlitzMax code. Scripts are just .bmx code with another extension.

Does BlitzMax include anything other than .bmx files? Is there any reason not to just let it include any arbitrary text file?


Otus(Posted 2007) [#2]
Didn't realize it even checks the extension (it does).

In "mbk_make.bmx" on lines 179-189:
		'includes
		For Local inc$=EachIn src_file.includes
			Local inc_ext$=ExtractExt(inc).ToLower()
			If Match(inc_ext,"bmx")
				Local dep:TFile=MakeSrc(RealPath(inc),False)
				If Not dep Continue
				If dep.time>src.time src.time=dep.time
			Else
				Throw "Unrecognized Include file type: "+inc
			EndIf
		Next


If you want to include other extensions it's as simple as modifying the If Match(... line to suit your needs. Or remove the If completely if you feel like it...