Mega Search
23.2 Million


Sign Up

Make a donation  
Using Environment Variables in Delphi  
News Group: embarcadero.public.delphi.ide

Hello,

I know how to use environment variables in RAD Studio and this is ok, 
but I have one small problem, I would like to add custom environment 
variables and use it in RAD Studio.
For example when I build project I'm using $(Platform), $(Config) and 
if it possible to add $(Release) vith values (free, standard, 
express,...) and RAD Studio will build on those directies?

Thanks in advance...

-- 
Sasa Mihajlovic
---
Life is to short to be boring, keep smiling...

Vote for best question.
Score: 0  # Vote:  0
Date Posted: 8-Jan-2015, at 2:45 AM EST
From: Sasa Mihajlovic
 
Re: Using Environment Variables in Delphi  
News Group: embarcadero.public.delphi.ide
Sasa wrote:

> I know how to use environment variables in RAD Studio and this is ok,
> but I have one small problem, I would like to add custom environment
> variables and use it in RAD Studio.

Tools > Options > Environment Options > Environment Variables > User overrides

> For example when I build project I'm using $(Platform), $(Config) and
> if it possible to add $(Release) vith values (free, standard,
> express,...) and RAD Studio will build on those directies?

And how do you expect to change the value of $(Release) per compile?  Environment 
variables are global, you can't change them on a per-compile basis, such 
as in Project Options.  $(Platform) and $(Config) are special because they 
are defined by the compiler itself based on the type of platform and build 
configuration that is being compiled for.  Other environment variables are 
static, they do not change value.  Unless maybe you define an environment 
variable at the system level, and then use a pre-build script to set the 
variable before compiling begins.  I have not tried that.

--
Remy Lebeau (TeamB)

Vote for best answer.
Score: 0  # Vote:  0
Date Posted: 8-Jan-2015, at 9:35 AM EST
From: Remy Lebeau (TeamB)