Dynamic search path for delphi

Hi

I need a different search path for Delphi compilation each run. I use the action Compile delphi Win32 Project, Tab Directories  Library path: Here I enter a long path and everything is fine. Biut when I try to do it dynamically thru a veraible, which I set before, to the same path,  I get the error :

Error expanding variables in Library or Search Path : Variable : DELPHI - does not exist!
I saw that there was a question about this in the past. I am using FB5 5.0.0.60

Am i missing something?

thanks Daphna Levin

 

 


What value is in your variable that you’re putting for the library path?

There are a couple of “magic” values that you can specify in a library or search path that FB will automatically replace for you - these values are $(DELPHI), $(BCB), and $(BDS). You can’t use the %'s instead for these special variables.

.t8

well I do

Set Variable COMP_PATH to Z:\OUTPUT\DCP;Z:\OUTPUT\BPL;$(DELPHI)\Lib;$(DELPHI)\Bin;$(DELPHI)\Imports;$(DELPHI)\Projects\Bpl;$(DELPHI)\source\ToolsApi;Z:\Lib\Delphi\Libs\Dates\4.0;Z:\Lib\Delphi\Libs\EventLog\1.0; ...

(the variable is very long)

and then in the Delphi I use this variable as I mentioned before. I didn't understand what should I do and how to combine the variables that use $(DELPHI) in the path.

Daphna

that usage looks fine, but what version of the Delphi compiler are you using? I think the $(DELPHI) variable only works up to D7, then you have to use $(BDS)

.t8

I have Delphi 5.0 (6.18) and, as I mentioned when I use the full path in the FB Delphi action it works fine , with this  path., the problem only occurs when I try to use a variable COMP_VAR , set it to the same string, and then in the FB write %COMP_VAR%. The FB doesn’t like it .

ok, the reason is that FB does a replacement of all $(DELPHI) “pseudo” variables first, and then does the normal expansion. It has to be done this way otherwise the $(DELPHI) will get treated as a normal variable. So - end result is that you can’t have those $(DELPHI) strings in your COMP_VAR variable… sorry.

.t8

So do you have any other solution to the problem?

Daphna,

Can you split the library path into two parts, one that is always required, and the other loaded from a variable?

eg. LibraryPath = $(DELPHI)\Lib;$(DELPHI)\Bin;$(DELPHI)\Imports;$(DELPHI)\Projects\Bpl;$(DELPHI)\source\ToolsApi;%COMP_VAR%

%COMP_VAR% = Z:\OUTPUT\DCP;Z:\OUTPUT\BPL;Z:\Lib\Delphi\Libs\Dates\4.0;Z:\Lib\Delphi\Libs\EventLog\1.0;