Recent

Author Topic: Why to hide ErrorString ????  (Read 1112 times)

mm7

  • Full Member
  • ***
  • Posts: 193
  • PDP-11 RSX Pascal, Turbo Pascal, Delphi, Lazarus
Why to hide ErrorString ????
« on: July 08, 2020, 12:24:54 am »
Guys, what was a purpose to hide ErrorString and not to include it in params?

process.pp
Code: Pascal  [Select][+][-]
  1. function RunCommandIndir(const curdir:string;const exename:string;const commands:array of string;out outputstring:string;out exitstatus:integer; Options : TProcessOptions = []):integer;
  2. Var
  3.     p : TProcess;
  4.     i : integer;
  5.     ErrorString : String;
  6. begin
  7.   p:=TProcess.create(nil);
  8.   if Options<>[] then
  9.     P.Options:=Options - ForbiddenOptions;
  10.   p.Executable:=exename;
  11.   if curdir<>'' then
  12.     p.CurrentDirectory:=curdir;
  13.   if high(commands)>=0 then
  14.    for i:=low(commands) to high(commands) do
  15.      p.Parameters.add(commands[i]);
  16.   result:=internalruncommand(p,outputstring,errorstring,exitstatus);
  17. end;    
  18.  

Now I need to repeat this function in my code

And internalruncommand(...) is also hidden!
So I need to repeat it as well ... :(

Bart

  • Hero Member
  • *****
  • Posts: 5274
    • Bart en Mariska's Webstek
Re: Why to hide ErrorString ????
« Reply #1 on: July 08, 2020, 10:39:45 am »
Well, then simply use TProcess?

Bart

 

TinyPortal © 2005-2018