Larger scripts are of course easier to handle in separate scripts which can be joined together by @INCLUDE at runtime.
I would like to test and write the individual parts separated from the main scripts which @includes them.
So the include script has to be complete with for example a waitevent loop.
If the @IF preprocessor could know if the script runs as a main script or as an included part then some parts could be automatically ignored if it is included, and could contain parts that needs to be run the "include" script individually.
Of course I can make a script with the waitevent loop and etc. and @INCLUDE the include script, but with something like an #included constant the include script could be self hosted.
What do you think?
#INCLUDED constant for @IF prepocessor
Re: #INCLUDED constant for @IF prepocessor
Sorry this topic is created to wrong place. The correct would be Hollywood/Wishlist.
- airsoftsoftwair
- Posts: 5443
- Joined: Fri Feb 12, 2010 2:33 pm
- Location: Germany
- Contact:
Re: #INCLUDED constant for @IF prepocessor
Hmm, maybe I'm not understanding everything here but couldn't you just set a constant that signals whether there's is a main script or not? i.e.
Code: Select all
; this is the main script
Const #MAINSCRIPT = 1
@INCLUDE "subscript.hws"
Code: Select all
; this is the subscript
@IF #MAINSCRIPT
...
@ELSE
...
@ENDIF