|
@@ -181,59 +181,45 @@ begin
|
|
end;}
|
|
end;}
|
|
|
|
|
|
|
|
|
|
-{function GetCommandLine: string;
|
|
|
|
|
|
+function GetArg(ArgNo: Integer; out ArgResult: string): Integer;
|
|
var
|
|
var
|
|
- len, I: Integer;
|
|
|
|
-begin
|
|
|
|
- len := PFarByte(Ptr(PrefixSeg, $80))^;
|
|
|
|
- SetLength(GetCommandLine, len);
|
|
|
|
- for I := 1 to len do
|
|
|
|
- GetCommandLine[I] := PFarChar(Ptr(PrefixSeg, $80 + I))^;
|
|
|
|
-end;}
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-{function GetArg(ArgNo: Integer; out ArgResult: string): Integer;
|
|
|
|
-var
|
|
|
|
- cmdln: string;
|
|
|
|
I: Integer;
|
|
I: Integer;
|
|
InArg: Boolean;
|
|
InArg: Boolean;
|
|
begin
|
|
begin
|
|
- cmdln := GetCommandLine;
|
|
|
|
ArgResult := '';
|
|
ArgResult := '';
|
|
- I := 1;
|
|
|
|
|
|
+ I := 0;
|
|
InArg := False;
|
|
InArg := False;
|
|
GetArg := 0;
|
|
GetArg := 0;
|
|
- for I := 1 to Length(cmdln) do
|
|
|
|
|
|
+ while CmdLine[I]<>#0 do
|
|
begin
|
|
begin
|
|
- if not InArg and (cmdln[I] <> ' ') then
|
|
|
|
|
|
+ if not InArg and (CmdLine[I] <> ' ') then
|
|
begin
|
|
begin
|
|
InArg := True;
|
|
InArg := True;
|
|
Inc(GetArg);
|
|
Inc(GetArg);
|
|
end;
|
|
end;
|
|
- if InArg and (cmdln[I] = ' ') then
|
|
|
|
|
|
+ if InArg and (CmdLine[I] = ' ') then
|
|
InArg := False;
|
|
InArg := False;
|
|
if InArg and (GetArg = ArgNo) then
|
|
if InArg and (GetArg = ArgNo) then
|
|
- ArgResult := ArgResult + cmdln[I];
|
|
|
|
|
|
+ ArgResult := ArgResult + CmdLine[I];
|
|
|
|
+ Inc(I);
|
|
end;
|
|
end;
|
|
-end;}
|
|
|
|
|
|
+end;
|
|
|
|
|
|
|
|
|
|
function paramcount : longint;
|
|
function paramcount : longint;
|
|
-{var
|
|
|
|
- tmpstr: string;}
|
|
|
|
|
|
+var
|
|
|
|
+ tmpstr: string;
|
|
begin
|
|
begin
|
|
-{ paramcount := GetArg(-1, tmpstr);}
|
|
|
|
- paramcount:=0;
|
|
|
|
|
|
+ paramcount := GetArg(-1, tmpstr);
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
|
|
function paramstr(l : longint) : string;
|
|
function paramstr(l : longint) : string;
|
|
begin
|
|
begin
|
|
-{ if l = 0 then
|
|
|
|
- paramstr := GetProgramName
|
|
|
|
|
|
+ if l = 0 then
|
|
|
|
+ paramstr := ''{GetProgramName}
|
|
else
|
|
else
|
|
- GetArg(l, paramstr);}
|
|
|
|
- paramstr:='';
|
|
|
|
|
|
+ GetArg(l, paramstr);
|
|
end;
|
|
end;
|
|
|
|
|
|
procedure randomize;
|
|
procedure randomize;
|