peter 26 роки тому
батько
коміт
4a1148c8b9
1 змінених файлів з 33 додано та 1 видалено
  1. 33 1
      rtl/objpas/objpas.pp

+ 33 - 1
rtl/objpas/objpas.pp

@@ -50,6 +50,9 @@ unit objpas;
      Procedure AssignFile(Var f:TypedFile;p:pchar);
      Procedure AssignFile(Var f:TypedFile;c:char);
 
+     { ParamStr should return also an ansistring }
+     Function ParamStr(Param : Integer) : Ansistring;
+
   implementation
 
 {****************************************************************************
@@ -128,10 +131,39 @@ begin
   system.Assign (F,C);
 end;
 
+Function ParamStr(Param : Integer) : Ansistring;
+
+Var Len : longint;
+
+begin
+    if (Param>=0) and (Param<argc) then
+      begin
+      Len:=0;
+      While Argv[Param][Len]<>#0 do 
+        Inc(len);
+      SetLength(Result,Len);
+      If Len>0 then 
+        Move(Argv[Param][0],Result[1],Len);
+      end
+    else
+      paramstr:='';
+  end;
+
 end.
 {
   $Log$
-  Revision 1.24  1999-05-17 21:52:43  florian
+  Revision 1.24.2.1  1999-07-07 20:37:38  peter
+    * paramstr():ansistring
+
+  Revision 1.26  1999/07/07 10:04:04  michael
+  + Paramstr now returns cmdline args >255 chars in ansistring objpas.pp
+
+  Revision 1.25  1999/07/06 22:44:22  florian
+    + implemented a paramstr function which returns an ansistring, nevertheless
+      it is limited to 255 chars because it maps to the system.paramstr, maybe
+      we should use cmdline instead
+
+  Revision 1.24  1999/05/17 21:52:43  florian
     * most of the Object Pascal stuff moved to the system unit
 
   Revision 1.23  1999/05/13 21:54:28  peter