Include Function

BlitzPlus Forums/BlitzPlus Programming/Include Function

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.

Lately while programming in BlitzPlus, I have been getting tired of having to type out all of the include functions by hand, so I thought I'd make a function to load them for me. But after making it and testing, it returns an error of 'Expecting include filename' If someone could please help out by showing me whats wrong I would be very greatful, thank you for your time.

Function load_scripts(path$)
	stream = ReadDir(path$)
	Repeat
		file$ = NextFile(stream)
		If Instr(file$,"bb") = 0
			;Null
		Else
			included$ = path$ + "/" + file$
			Include included$
			included$ = ""
		EndIf
	Until file$ = ""
	CloseDir(stream)
End Function