mirror of
https://gitlab.com/freepascal.org/fpc/pas2js.git
synced 2025-09-15 11:39:07 +02:00
* Implement paramstr as elements in hash, separated by /
This commit is contained in:
parent
55272f7a26
commit
3b79dd0a67
@ -68,9 +68,21 @@ end;
|
|||||||
|
|
||||||
procedure ReloadParamStrings;
|
procedure ReloadParamStrings;
|
||||||
|
|
||||||
|
Var
|
||||||
|
ParsLine : String;
|
||||||
|
Pars : Array of String;
|
||||||
|
I : integer;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
SetLength(Params,1);
|
ParsLine:=Copy(window.location.hash,2);
|
||||||
|
If ParsLine<>'' then
|
||||||
|
Pars:=ParsLine.Split(['/'])
|
||||||
|
else
|
||||||
|
SetLength(Pars,0);
|
||||||
|
SetLength(Params,1+Length(Pars));
|
||||||
Params[0]:=Window.location.pathname;
|
Params[0]:=Window.location.pathname;
|
||||||
|
For I:=0 to Length(Pars)-1 do
|
||||||
|
Params[1+I]:=Pars[I];
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
@ -81,7 +93,8 @@ end;
|
|||||||
|
|
||||||
function GetParamStr(Index: longint): String;
|
function GetParamStr(Index: longint): String;
|
||||||
begin
|
begin
|
||||||
Result:=Params[Index]
|
if (Index>=0) and (Index<Length(Params)) then
|
||||||
|
Result:=Params[Index];
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function MyGetEnvironmentVariable(Const EnvVar: String): String;
|
function MyGetEnvironmentVariable(Const EnvVar: String): String;
|
||||||
|
Loading…
Reference in New Issue
Block a user