Browse Source

*** empty log message ***

florian 24 năm trước cách đây
mục cha
commit
f34aaa82da
2 tập tin đã thay đổi với 39 bổ sung0 xóa
  1. 33 0
      tests/tbs/tb0364.pp
  2. 6 0
      tests/tbs/tb0365.pp

+ 33 - 0
tests/tbs/tb0364.pp

@@ -0,0 +1,33 @@
+uses
+   sysutils;
+
+{ comment by submitter: 
+  The following statement (which works in Delphi)
+    result:=Format('%10.n', [ival*1.0]);
+  generated an unhandled exception (and said: Missing argument in format "").
+  Checking the Delphi documentation, it agrees with the fpc documentation
+  (units.pdf), that a dot should be followed by a <prec> (but Delphi does
+  not appear to explicitly state that prec should be an integer).
+  It appears that Delphi is treating this like %10.0n, although it is
+  potentially undefined behaviour.  The fpc documentation indicates I
+  should get an EConversionError exception if there are problems.
+  (Actually the documentation may be inconsistent, since it also says
+  I may get an EConvertError exception.)
+
+  If I change the format string to %10.0n, the program runs OK using
+  fpc, however, my thousand separators do not appear.
+}
+
+var
+   s : string;
+   ival : integer;
+
+begin
+   ival:=1234;
+   s:=Format('%10.n', [ival*1.0]);
+   if s<>'     1.234' then
+     begin
+        writeln('Problem with Format');
+        halt(1);
+     end;
+end.

+ 6 - 0
tests/tbs/tb0365.pp

@@ -0,0 +1,6 @@
+var
+   t : textfile;
+
+begin
+   assign(t,'test');
+end.