3

Background

I use run time (plugin) BPL's and a host application. For whatever reason I sometimes need to debug my bpl without switching to the host app, so I can set the 'Host application' in the debugging options.

I have multiple versions of my project (eg maintenance and trunk) and I want to use relative paths, or preferably even de output path. SO I set my host application (for running/debugging a bpl) to $PATH($EXENAME)\HostApp.exe. But it appears RS10.3 does NOT resolve these macros when trying to start the host application. (AFAIK older versions don't do this either).

It appears the same applies to the command line parameters, though something like $(SomeEnvVar) is expanded to %SomeEnvVar% on the command line.

The question

How can I start my (host) application without using an absolute path to my binaries, within the RS10.3 IDE?

I have created an issue on the embarcadero site. Please upvote there to shake things up :)

I created a test app, but only tests for cmdline params. Here are settings and results:

Debugger settings

Results

Sourcecode is little relevant and very elementary, but added for completeness.

procedure TfrmMain.DoShow;
VAR i:integer;
begin
  inherited;
  Memo1.Clear;
  for i:=0 to ParamCount-1 do
    Memo1.Lines.Add(ParamStr(i));
end;
4
  • These $(xx) items are environment variables. Obviously the Parameters field doesn't recognize any macros. Oh, and you can do for I := 0 to ParamCount. ParamStr(0) is not a parameter, it is the exe name, and params go from 1 to ParamCount. You obviously missed the last parameter. Jan 30, 2019 at 15:25
  • You, I found that out too. By now I tried by passing the output path using the envinronment variables section of the debugger options. No luck there either.
    – H.Hasenack
    Jan 30, 2019 at 15:32
  • I defined a new environment variable COCOLORES with value C:\Tools\ (a valid directory on my HD) and indeed, it showed as %COCOLORES% and not as C:\Tools\ Jan 30, 2019 at 15:56
  • Created an issue on the embarcadero site as suggested. Please upvote there to set things in motion ;)
    – H.Hasenack
    Jan 31, 2019 at 8:22

1 Answer 1

2

The Parameters line doesn't recognize any macros. You can use environment variables (as you can find in the Environment Block in the same dialog).

So if you enter $(BDS) or $(APPDATA) you will get the resolved environment variables, e.g. in my case:

c:\embarcadero\studio\20.0
C:\Users\Rudy\AppData\Roaming

That is also why $(EXENAME) resolves to %EXENAME%: it can't be resolved to the value of an environment variable.

But unfortunately, you can't use any macros like $PATH($EXENAME) here. They only seem to work in the Tools | Configure Tools dialog.

It would be nice if they could be used in the Parameters of the Debugger too. You could suggest it in Quality Portal.

3
  • Indeed. So it is not an A to the Q :(
    – H.Hasenack
    Jan 30, 2019 at 15:43
  • An answer that tells you you can't do something is an answer too. It is not a solution for your problem, but certainly a valid answer. Jan 30, 2019 at 15:44
  • So it is not a S to the P :( - ah sorry Rudy, I hit the <enter> button to quickly.. Before adding the issue to the quality portal, I just wanted to make sure I wasn't reinventing the wheel ;)
    – H.Hasenack
    Jan 30, 2019 at 15:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.