Allow GetEnvironmentVariable() in Include statements

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
Mistrel
Addict
Addict
Posts: 3415
Joined: Sat Jun 30, 2007 8:04 pm

Allow GetEnvironmentVariable() in Include statements

Post by Mistrel »

Yes, it is possible to hard-code a constant in your project for this but it would be a lot more portable on systems where these paths may change.

For example:

Code: Select all

XInclude GetEnvironmentVariable("SDK_PATH")+"somewhere/to/file.pb"
Functionally it would be acceptable but somewhat less flexible if I could somehow add a constant to the project using "Compiler -> Compiler Options... -> Constants" but have that constant reference a environment variable.

I say the second option is less flexible because it makes copy/paste more cumbersome as I would always have to setup the constant.