From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- .../vbarray/toarray/index.html | 84 ++++++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 files/fr/archive/web/javascript/extensions_microsoft/vbarray/toarray/index.html (limited to 'files/fr/archive/web/javascript/extensions_microsoft/vbarray/toarray/index.html') diff --git a/files/fr/archive/web/javascript/extensions_microsoft/vbarray/toarray/index.html b/files/fr/archive/web/javascript/extensions_microsoft/vbarray/toarray/index.html new file mode 100644 index 0000000000..377b5ba29f --- /dev/null +++ b/files/fr/archive/web/javascript/extensions_microsoft/vbarray/toarray/index.html @@ -0,0 +1,84 @@ +--- +title: VBArray.toArray +slug: Archive/Web/JavaScript/Extensions_Microsoft/VBArray/toArray +tags: + - JavaScript + - Méthode + - Non-standard + - Reference +translation_of: Archive/Web/JavaScript/Microsoft_Extensions/VBArray/toArray +--- +
{{JSRef}}{{Non-standard_header}}
+ +
Attention ! Cette méthode est spécifique à Microsoft et ne fonctionne qu'avec Internet Explorer.
+ +

La méthode VBArray.toArray() renvoie un tableau JavaScript {{jsxref("Array")}} à partir d'une valeur {{jsxref("VBArray")}}.

+ +

Syntaxe

+ +
monVBArray.toArray()
+ +

Valeur de retour

+ +

La valeur VBArray convertie en {{jsxref("Array")}}. Un tableau VBArray étant multi-dimensionnel, il est aplati avec les tableaux des dimensions les uns à la suite des autres. Ainsi, si le tableau VBArray contient [1,2,3][4,5,6][7,8,9], il sera converti en un tableau Array ayant la structure [1,2,3,4,5,6,7,8,9].

+ +

Il n'existe aucune méthode qui permette de convertir un tableau {{jsxref("Array")}} en {{jsxref("VBArray")}}.

+ +

Exemples

+ +
<head>
+  <script type="text/vbscript">
+  <!--
+  Function CreateVBArray()
+     Dim i, j, k
+     Dim a(2, 2)
+     k = 1
+     For i = 0 To 2
+        For j = 0 To 2
+           a(j, i) = k
+           document.writeln(k)
+           k = k + 1
+        Next
+        document.writeln("<br />")
+     Next
+     CreateVBArray = a
+  End Function
+  -->
+  </script>
+
+  <script type="text/javascript">
+  <!--
+  function VBArrayTest(vbarray) {
+     var a = new VBArray(vbarray);
+     var b = a.toArray();
+     var s = "";
+     for (i = 0; i < 9 ; i++) {
+       console.log(b[i]);
+     }
+  }
+  -->
+  </script>
+</head>
+
+<body>
+  <script type="text/javascript">
+    <!--
+    VBArrayTest(CreateVBArray());
+    -->
+  </script>
+</body>
+ +

Prérequis

+ +

Cette fonctionnalité est prise en charge par les modes suivants : Quirks, Internet Explorer 6 en mode standard, Internet Explorer 7 en mode standard, Internet Explorer 8 en mode standard, Internet Explorer 9 en mode standard et Internet Explorer 10 en mode standard. Elle n'est pas prise en charge par les applications Windows 8.x Store.

+ +

Voir aussi

+ + -- cgit v1.2.3-54-g00ecf