Browse Source

* The test was wrong, the values to insert into the collections are pstrings, not pchar.

carl 23 years ago
parent
commit
82b456f4f8
1 changed files with 2 additions and 3 deletions
  1. 2 3
      docs/objectex/ex39.pp

+ 2 - 3
docs/objectex/ex39.pp

@@ -17,10 +17,9 @@ begin
     begin
     Str(Random(100),S);
     S:='String with value '+S;
-    P:=StrAlloc(Length(S)+1);
-    C^.Insert(StrPCopy(P,S));
+    C^.Insert(NewStr(S));
     end;
   For I:=0 to 99 do
-    Writeln (I:2,': ',PChar(C^.At(i)));
+    Writeln (I:2,': ',PString(C^.At(i))^ );
   Dispose(C,Done);
 end.