Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2012-07

TProcess-problem

4 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Koenraad Lelong

Hi,

I'm updating an application that uses Tprocess to execute an external (DOS) application. My new version does not work any more and I don't know how to solve this.

I created a TProcess and assinged the executable. Then I added a parameter line. Executing that gives an error that a needed file is not found.
To debug this, I create a batch-file from within the Lazarus-application containing the executable and the parameter line. Executing that batch-file from the directory where my Lazarus-app is located works, the needed file is found.

Any suggestions to debug this ? What do I have to do to keep the dos-box open ? Then, maybe, I can see more about the problem. Now it opens and closes too fast, impossible to see anything. The error I can see because I use a pipe to get the output of the dos-application.

That's under Windows, using Lazarus 0.9.30.4.

Thanks,

Koenraad Lelong.

Reply by email

Ludo Brands
to Koenraad Lelong
That's under Windows, using Lazarus 0.9.30.4.

What is the fpc version? Tprocess is part of fpc. There have been some changes recently in trunk because of parameter quoting problems. Can you give an example of the executable and parameters that fail?

Ludo

Reply by email

Koenraad Lelong
to Ludo Brands: What is the fpc version? Tprocess is part of fpc. There have been some changes recently…
Ludo Brands wrote 9 lines
> > That's under Windows, using Lazarus 0.9.30.4. > What is the fpc version? Tprocess is part of fpc. There have been some changes recently in trunk because of parameter quoting problems. Can you give an example of the executable and parameters that fail? Ludo

Hi Ludo,

I'm using fpc 2.6.0. I prefer using the stable releases.

My older version used "commandline" and that does work. This is my
old-code :
pk2cmd.CommandLine:=PicKitFile+' /B'+ExtractFilePath(PicKitFile)+' /P
/F'+PICFile+' /E /M /Y /J /R';
//pk2cmd.Executable:=PicKitFile;
So I tried to "shortcut" to the new method :
executable:=PicKitFile;
Parameter[0]:="rest of commandline"

That does not work. I have to add every parameter on its own. Then it works.

Thanks anyway,

Koenraad

Reply by email