I have tried to capture a command line parameter without success. I’m pretty sure it’s just a matter of where it reads the parameters.
Can you show an example of how and where to use the paramStr in the UserMain HEScript along with a custom parameter?
I have this example procedure in the HEScript, but where to call it from?
procedure GetParams;
Var
i, ParamCount: integer;
begin
ShowMessage(intToStr(ParamCount));
for i := 0 to ParamCount do
ShowMessage("Parameter "+IntToStr(i)+" = "+ParamStr(i));
end;
So, it seems the ParamCount is a system variable and should not be declared locally. But when I remove the local variable declaration, ParamCount cannot be found. If I put in the Uses System; at the top of script, then get some kind of not registered error.
You did not mention where to use this code at?
I’m trying to use this in the OnPubLoaded function but in Pascal code it would be called in the main startup code to get the ParamCount.
procedure GetParams;
Var
i: integer;
begin
ShowMessage(intToStr(ParamCount));
for i := 1 to ParamCount do
ShowMessage("Parameter "+IntToStr(i)+" = "+ParamStr(i));
end;
I just double-checked and unfortunately ParamCount does not exist in HTML Executable. Only ParamStr is recognized. So I added to our TODO list so that it is added in the next update.