In Delphi XE2 I am setting up a search path. I would like to use a system variable, that I define, to shorten the strings of the various folders used in the search path.
I do it like this:
Search path : x:\Delphi Library\XTools;x:\Delphi Library\XDiag;
I define variable : L = x:\Delphi Library
Search path using L : $(L)\XTools;$(L)\XDiag;
If I don't use the defined environment variable, that is write out the path in full, all is well but if i do use the environment variable the compiler does not understand the search path.
I have been using Delphi 3 which is considerably simpler than XE2 so perhaps I'm not specifying either the path or the variable in exactly the right place:
Path is specified here:
Project Manager|Project|Options|Delphi Compiler|Target All Configurations - All Platforms|Search Path
Variable is specified here:
Project Manager|Project|Options|Debugger|Target: All Configurations - All Platforms|Environment Block|User Overrides
I just did the following, in XE2:
Tools|Options|Environment variables
, I defined a user override to the directory of my AutoConsole.pas
unit, as new variable L
.$(L)
AutoConsole
to the uses
clause of that projectAutoConsole
did what it should do: it presented me with a message Press any key...
and waited for a keypress. $(L)
from the search pathAutoConsole
.$(L)
and the program compiled and worked again.So what you wanted to do should work. I have no idea what you did wrong, but if you do things like I did, it should work.