IncludeOnce command for blitz3d

Blitz3D Forums/Blitz3D Programming/IncludeOnce command for blitz3d

Hardcoal(Posted 2011) [#1]
it would be nice to have such a command so when you include
some file allready it wouldnt be included again.
is it possible to make an addon like this easy?


Matty(Posted 2011) [#2]
What do you mean?

The include command only needs to be called once per file anyway - why would you want to include the same source file multiple times..


Hardcoal(Posted 2011) [#3]
sometimes you call 2 includes that both have the same include file

Lets say you have Math Function Include file
and many of your other includes use this Library of functions

Just for the good order it would be nice that they will ignore to include it again once they see it was allready been loaded once.

Its just for the good order of things, its not like its the end of the world doing without it.


Warner(Posted 2011) [#4]
By default, every file can only be included once. You can try it out by placing a Print statement into the included file, then try to include it several times. The Print statement is only executed once.


Hardcoal(Posted 2011) [#5]
didnt realize that up till now tnx