@Fred
There is an error in your code that causes an exception:
If the params array does not have paramstr(1),paramstr(2) the program crashes.
To fix, use paramcount:
// full program
uses RegExpr;
begin
if paramcount >= 2 then // check!!!
begin
writeln(RegExpr.ExecRegExpr(ParamStr(1), ParamStr(2)));
writeln(RegExpr.ExecRegExpr('^$', ''));
end;
end.
Paramstr(0), the executable name, is not counted towards paramcount.
That may be all. With two or more "''" (empty) parameters this prints true, true, otherwise prints false where the parameters are filled or otherwise does nothing.
(The double quotes are just illustrating, use '' or "" (two quotes of the same type))
BTW: not a bug: maps to argc/argv.
(which is a
ppointer to an array of PChar closed with a double zero.)