Kaynağa Gözat

* commatext fixed

peter 25 yıl önce
ebeveyn
işleme
7bb8db21bd
1 değiştirilmiş dosya ile 75 ekleme ve 24 silme
  1. 75 24
      fcl/inc/stringl.inc

+ 75 - 24
fcl/inc/stringl.inc

@@ -103,10 +103,13 @@ begin
   P1:=P+1;
   While P1^<>#0 do
     begin
-    If (P1^='"') and (P1[1]<>'"') then
-      break;
-    P1:=P1+1;
-    If P1^='"' then P1:=P1+1;
+      If (P1^='"') then
+       begin
+         if (P1[1]<>'"') then
+          break;
+         inc(p1);
+       end;
+      inc(p1);
     end;
   // P1 points to last quote, or to #0;
   P:=P+1;
@@ -120,25 +123,33 @@ begin
 end;
 
 
-Function GetNextQuotedChar (P : PChar; Var S : String): Boolean;
+Function GetNextQuotedChar (var P : PChar; Var S : String): Boolean;
 
 Var PS,L : PChar;
 
 begin
   Result:=False;
-  If P^=#0 then exit;
   S:='';
-  While (p^<>#0) and (byte(p^)<=byte(' ')) do P:=P+1;
+  While (p^<>#0) and (byte(p^)<=byte(' ')) do
+   inc(p);
+  If P^=#0 then exit;
   PS:=P;
   If P^='"' then
-    S:=GetQuotedString(P)
+   begin
+     S:=GetQuotedString(P);
+     While (p^<>#0) and (byte(p^)<=byte(' ')) do
+      inc(p);
+   end   
   else
-    begin
-    While (p^>' ') and (P^<>',') do P:=P+1;
-    Setlength (S,P-PS);
-    L:=Pointer(S);
-    Move (PS^,L,P-PS);
-    end;
+   begin
+     While (p^>' ') and (P^<>',') do
+      inc(p);
+     Setlength (S,P-PS);
+     L:=Pointer(S);
+     Move (PS^,L,P-PS);
+   end;
+  if p^=',' then
+   inc(p);  
   Result:=True;
 end;
 
@@ -151,7 +162,8 @@ Var P : Pointer;
 begin
   Self.Clear;
   P:=Pointer(Value);
-  While GetNextQuotedChar (P,S) do Add (S);
+  While GetNextQuotedChar (P,S) do
+   Add (S);
 end;
 
 
@@ -342,7 +354,7 @@ begin
       self.AddObject (Thestrings[Runner],TheStrings.Objects[Runner]);
   finally
     EndUpdate;
-  end;    
+  end;
 end;
 
 
@@ -361,7 +373,7 @@ begin
     Inherited Assign(Source);
   finally
     EndUpdate;
-  end;  
+  end;
 end;
 
 
@@ -416,9 +428,9 @@ begin
     Strings[Index1]:=Strings[Index2];
     Objects[Index2]:=Obj;
     Strings[Index2]:=Str;
-  finally  
+  finally
     EndUpdate;
-  end;  
+  end;
 end;
 
 
@@ -586,10 +598,10 @@ begin
     beginUpdate;
     Clear;
     While GetNextLine (TheText,S) do
-    Add(S); 
+    Add(S);
   finally
     EndUpdate;
-  end;   
+  end;
 end;
 
 
@@ -957,7 +969,46 @@ end;
 
 {
   $Log$
-  Revision 1.2  2000-07-13 11:33:01  michael
-  + removed logs
- 
+  Revision 1.1.2.1  2000-11-22 22:43:34  peter
+    * commatext fixed
+
+  Revision 1.1  2000/07/13 06:31:31  michael
+  + Initial import
+
+  Revision 1.11  2000/03/07 07:50:55  michael
+  + Added ebginupdate/endupdate
+
+  Revision 1.10  2000/01/07 01:24:33  peter
+    * updated copyright to 2000
+
+  Revision 1.9  2000/01/06 01:20:33  peter
+    * moved out of packages/ back to topdir
+
+  Revision 1.1  2000/01/03 19:33:08  peter
+    * moved to packages dir
+
+  Revision 1.7  1999/12/22 01:08:18  peter
+    * use reallocmem/freemem/getmem from the heapmanager
+
+  Revision 1.6  1999/11/25 13:28:13  michael
+  + Fixed bug in settext
+
+  Revision 1.5  1999/07/07 12:34:01  peter
+    * removed debug writeln
+
+  Revision 1.4  1999/05/26 13:22:23  michael
+  + Fixed insertitem
+
+  Revision 1.3  1999/04/27 07:46:18  michael
+  * Fixed bug that caused error in loadfromstream when last line in stream has not CRLF pair
+
+  Revision 1.2  1999/04/15 07:51:45  michael
+  + Bugfix in strings.Loadfromstream
+
+  Revision 1.1  1999/04/13 08:52:28  michael
+  + Moved strings.inc to stringl.inc, to avoid conflict with strings unit
+
+  Revision 1.15  1999/04/08 10:18:56  peter
+    * makefile updates
+
 }