Preprocessor/Compiler directives...
-
So I think preprocessor/compiler directives would be a good addition to the editor. I'm building slightly different versions of products so I'm thinking of:
#DEF DEMOMODE = 1 // then later... #IFDEF DEMOMODE //some code here.... #ELSEDEF //some other code here #ENDIFDEF
unless of course "I'm being stupid..." and this is already available somehow...
-
@Lindon Couldn't you just do that with a regular if statement and a constant?
-
@d-healey said in Preprocessor/Compiler directives...:
@Lindon Couldn't you just do that with a regular if statement and a constant?
no, this isnt code logic... it code includes/excludes - so your final shipped code includes some code or not. Thus "preprocessor"
-
I put all my code into namespaces and just comment out or remove ones that I don't want to ship in the final product but I can see how this would be a more automated solution.
-
@d-healey said in Preprocessor/Compiler directives...:
I put all my code into namespaces and just comment out or remove ones that I don't want to ship in the final product but I can see how this would be a more automated solution.
yeah its been in the KSP editor(Sublime) for a long time - I used to use it a LOT.
-
@Lindon The only use case I can think of in my projects is removing UI factory stuff. What kind of things will you use it for?
-
@d-healey the example is mostly a give away....
I want to build a demo version of my app -that times out after <period>and is run-able only a fixed number of times, and may have reduced functionality...
I want a "full" version of my app that doesnt do (or is missing) any of that stuff - but it always asks for the serial first time thru.
So really this gives me the flexibility to build a demo version and a full version from (nearly) the same codebase...