ReDim

ReDim

ReDim, short for re-dimension, is a Visual Basic function that is used to resize arrays. By using this function you can add or remove space from an array. This function can only be used on arrays that are declared "without" dimensions. [ [http://msdn.microsoft.com/en-us/library/w8k3cys2(VS.80).aspx ReDim Statement (Visual Basic)] ]

For example, in the following declaration

The Preserve keyword is used to keep the data in an array intact. The syntax is as follows:

ReDim MyArray(3)
ReDim Preserve MyArray(3)

For arrays of multiple dimensions, you can only ReDim the latest dimension after the array has been redimensioned once, and your initial declaration must match the number of dimensions you want to use.

This works:Dim MyArray(,)
ReDim MyArray(1, 3)
ReDim MyArray(1, 4)

This does not work:Dim MyArray()
ReDim MyArray(1, 3)

This does not work:Dim MyArray(,)
ReDim MyArray(1, 3)
ReDim MyArray(2, 3)

References


Wikimedia Foundation. 2010.

Игры ⚽ Поможем написать реферат

Look at other dictionaries:

  • REDİM — Eski, köhne kaftan …   Yeni Lügat Türkçe Sözlük

  • Criba de Eratóstenes — Saltar a navegación, búsqueda La criba de Eratóstenes es un algoritmo que permite hallar todos los números primos menores que un número natural dado N. Se forma una tabla con todos los números naturales comprendidos entre 2 y N y se van tachando… …   Wikipedia Español

  • Ordenamiento por mezcla — El algoritmo de ordenamiento por mezcla (merge sort en inglés) es un algoritmo de ordenamiento externo estable basado en la técnica divide y vencerás. Es de complejidad O(n log n). Contenido 1 Descripción 2 Implementaciones 2.1 Perl …   Wikipedia Español

  • СЛАУ — Система m линейных уравнений с n неизвестными (или, линейная система) в линейной алгебре это система уравнений вида (1) Здесь x1, x2, …, xn неизвестные, которые надо определить. a11, a12, …, amn коэффициенты системы и b1, b2, … bm свободные члены …   Википедия

  • Modified Dietz Method — The Modified Dietz Method is a calculation used to determine an approximation of the performance of an investment portfolio based on money weighted cash flow.[1] A more precise way of calculating performance in the presence of external cash flows …   Wikipedia

  • YaBasic — YaBasic, qui signifie Yet Another Basic, est un interprète du langage BASIC pour les plateformes Unix, Windows et PlayStation 2. Similaire au Commodore BASIC du Commodore 64, il supporte le mode graphique couleur et a des possibilités d… …   Wikipédia en Français

  • Yabasic — YaBasic, qui signifie Yet Another Basic, est un interprète du langage BASIC pour les plateformes Unix, Windows et PlayStation 2. Similaire au Commodore BASIC du Commodore 64, il supporte le mode graphique couleur et a des possibilités d… …   Wikipédia en Français

  • Yabasic interpreter — YaBasic YaBasic, qui signifie Yet Another Basic, est un interprète du langage BASIC pour les plateformes Unix, Windows et PlayStation 2. Similaire au Commodore BASIC du Commodore 64, il supporte le mode graphique couleur et a des possibilités d… …   Wikipédia en Français

  • ROT13 — El ROT13 sustituye cada letra por su pareja, 13 caracteres por delante en el alfabeto. Por ejemplo, HOLA se convierte en UBYN (o, descifrando, UBYN se convierte en HOLA de nuevo) …   Wikipedia Español

  • Centro de Estudios Comunitarios — Saltar a navegación, búsqueda Centro de Estudios Comunitarios, es un centro de investigaciones de la Facultad de Derecho de la Universidad Nacional de Rosario, en Argentina, dedicado al estudio de la integración regional, especialmente el… …   Wikipedia Español

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”