hedgewars/ArgParsers.pas
branchqmlfrontend
changeset 12863 0c6fb706f747
parent 11833 a69124eb7ce7
equal deleted inserted replaced
12862:90f927b4b9e1 12863:0c6fb706f747
   320     index, nextIndex: LongInt;
   320     index, nextIndex: LongInt;
   321     wrongParameter: boolean;
   321     wrongParameter: boolean;
   322 var tmpInt: LongInt;
   322 var tmpInt: LongInt;
   323 begin
   323 begin
   324 
   324 
   325     paramIndex:= {$IFDEF HWLIBRARY}0{$ELSE}1{$ENDIF};
   325     paramIndex:= 0;
   326     paramTotal:= ParamCount; //-1 because pascal enumeration is inclusive
   326     paramTotal:= ParamCount;
   327     
   327     
   328     WriteLn(stdout, 'total parameters: ' + inttostr(paramTotal));
   328     WriteLn(stdout, 'total parameters: ' + inttostr(paramTotal));
   329     tmpInt:= 0;
   329     tmpInt:= 0;
   330     while (tmpInt <= paramTotal) do
   330     while (tmpInt <= paramTotal) do
   331         begin
   331         begin
   332         WriteLn(stdout, inttostr(tmpInt) + ': ' + {$IFDEF HWLIBRARY}argv[tmpInt]{$ELSE}paramCount(tmpInt){$ENDIF});
   332         WriteLn(stdout, inttostr(tmpInt) + ': ' + argv[tmpInt]);
   333         inc(tmpInt);
   333         inc(tmpInt);
   334         end;
   334         end;
   335     
   335     
   336     wrongParameter:= false;
   336     wrongParameter:= false;
   337     while (paramIndex <= paramTotal) do
   337     while (paramIndex <= paramTotal) do