Browse Source

* Delphi compatibility: VarArrayOf([]) should create empty array of variant.
+ test.

git-svn-id: trunk@7735 -

yury 18 years ago
parent
commit
1ae31b4037
2 changed files with 17 additions and 0 deletions
  1. 1 0
      .gitattributes
  2. 16 0
      tests/webtbs/tw9098.pp

+ 1 - 0
.gitattributes

@@ -8303,6 +8303,7 @@ tests/webtbs/tw9054.pp svneol=native#text/plain
 tests/webtbs/tw9076.pp svneol=native#text/plain
 tests/webtbs/tw9076a.pp svneol=native#text/plain
 tests/webtbs/tw9085.pp svneol=native#text/plain
+tests/webtbs/tw9098.pp svneol=native#text/plain
 tests/webtbs/tw9107.pp svneol=native#text/plain
 tests/webtbs/ub1873.pp svneol=native#text/plain
 tests/webtbs/ub1883.pp svneol=native#text/plain

+ 16 - 0
tests/webtbs/tw9098.pp

@@ -0,0 +1,16 @@
+uses variants;
+
+var
+  v: variant;
+  i: longint;
+begin
+  v:=VarArrayOf([1, True, '123']);
+  for i:=VarArrayLowBound(v, 1) to VarArrayHighBound(v, 1) do
+    Writeln(v[i]);
+
+  v:=VarArrayOf([]);
+  if VarType(v) <> 8204 then begin
+    writeln('Wrong vartype: ', VarType(v));
+    Halt(1);
+  end;
+end.