Sign in Join

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

Mailing lists / fpc-pascal / 2003-05

Compiler error on TProcess.Create

3 messages · 3 people ·

Reply by email Subscribe to this list Your subscription

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

Ronald L Fox

Aloha,

Trying to use the TProcess object of fpc 1.0.6 for Win32 on Win2k and I've studied the process.txt file found in the FCL win32 source directory but can't get past a compiler error that claims "wrong number of parameters specified". Program source and compiler output follow. Can anyone see what my problem is?

Mahalo,
Ron

program proctest;
uses Process;
var myProc : TProcess;
begin
   myProc := TProcess.Create( 'c:\my-fpc\initest.exe', [ poNoConsole,
poWaitOnExit ]);
   myProc.Execute;
   myProc.Destroy;
end.

C:\my-fpc>ppc386 proctest.pas
Free Pascal Compiler version 1.0.6 [2002/04/23] for i386 Copyright (c) 1993-2002 by Florian Klaempfl
Target OS: Win32 for i386
Compiling proctest.pas
proctest.pas(9,55) Error: Wrong amount of parameters specified proctest.pas(14,4) Fatal: There were 1 errors compiling module, stopping

C:\my-fpc>

Ronald L Fox Email:
Diagnostic Laboratory Services, Inc.
Honolulu, Hawaii

Reply by email

Michael Van Canneyt
to Ronald L Fox
Ronald L Fox wrote 26 lines
Aloha, Trying to use the TProcess object of fpc 1.0.6 for Win32 on Win2k and I've studied the process.txt file found in the FCL win32 source directory but can't get past a compiler error that claims "wrong number of parameters specified". Program source and compiler output follow. Can anyone see what my problem is? Mahalo, Ron program proctest; uses Process; var myProc : TProcess; begin myProc := TProcess.Create( 'c:\my-fpc\initest.exe', [ poNoConsole, poWaitOnExit ]); myProc.Execute; myProc.Destroy; end.

The readme file is outdated :/

Try this instead:

  Myproc:=Tprocess.Create(Nil);
  Myproc.Commandline:='c:\my-fpc\initest.exe';
  Myproc.Options:=[poNoConsole,poWaitOnExit];
  MyProc.Execute;

I'll adapt the readme file.

Michael.

Reply by email

Ronald Fox
to Michael Van Canneyt

Michael,

That worked like a charm!

Thanks for the lightning-fast response,
Ron

Michael Van Canneyt wrote 12 lines
The readme file is outdated :/ Try this instead: Myproc:=Tprocess.Create(Nil); Myproc.Commandline:='c:\my-fpc\initest.exe'; Myproc.Options:=[poNoConsole,poWaitOnExit]; MyProc.Execute; I'll adapt the readme file. Michael.

Reply by email