powered by simpleCommunicator - 2.0.60     © 2026 Programmizd 02
Целевая тема:
Создать новую тему:
Автор:
Закрыть
Цитировать
Форумы / Visual Basic [игнор отключен] [закрыт для гостей] / как в VBScript создать динамический массив?
3 сообщений из 3, страница 1 из 1
как в VBScript создать динамический массив?
    #32638983
Фотография superbluesman
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
Подскажите как в VBScript (я юзаю DTS в MS SQL 2000) создать динамический массив?

В VBA это было так:
Dim MyArray() As Integer
ReDim MyArray(0)

ReDim Preserve MyArray(ln_Ubound)


А как в VBScript ???
...
Рейтинг: 0 / 0
как в VBScript создать динамический массив?
    #32638991
Фотография big-duke
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
Microsoft® Visual Basic® Scripting Edition
ReDim Statement Language Reference
Version 1


See Also


--------------------------------------------------------------------------------

Description
Used at procedure level to declare dynamic-array variables and allocate or reallocate storage space.
Syntax
ReDim [Preserve] varname(subscripts) [, varname(subscripts)] . . .
The ReDim statement syntax has these parts:

Part Description
Preserve Preserves the data in an existing array when you change the size of the last dimension.
varname Name of the variable; follows standard variable naming conventions.
subscripts Dimensions of an array variable; up to 60 multiple dimensions may be declared. The subscripts argument uses the following syntax:
upper [,upper] . . .

The lower bound of an array is always zero.



Remarks
The ReDim statement is used to size or resize a dynamic array that has already been formally declared using a Private, Public, or Dim statement with empty parentheses (without dimension subscripts). You can use the ReDim statement repeatedly to change the number of elements and dimensions in an array.
If you use the Preserve keyword, you can resize only the last array dimension, and you can't change the number of dimensions at all. For example, if your array has only one dimension, you can resize that dimension because it is the last and only dimension. However, if your array has two or more dimensions, you can change the size of only the last dimension and still preserve the contents of the array.

The following example shows how you can increase the size of the last dimension of a dynamic array without erasing any existing data contained in the array.

ReDim X(10, 10, 10)
. . .
ReDim Preserve X(10, 10, 15)


--------------------------------------------------------------------------------

Caution If you make an array smaller than it was originally, data in the eliminated elements is lost.

--------------------------------------------------------------------------------


When variables are initialized, a numeric variable is initialized to 0 and a string variable is initialized to a zero-length string (""). A variable that refers to an object must be assigned an existing object using the Set statement before it can be used. Until it is assigned an object, the declared object variable has the special value Nothing.
...
Рейтинг: 0 / 0
как в VBScript создать динамический массив?
    #32639029
Фотография superbluesman
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
всё, сам разобрался
...
Рейтинг: 0 / 0
3 сообщений из 3, страница 1 из 1
Форумы / Visual Basic [игнор отключен] [закрыт для гостей] / как в VBScript создать динамический массив?
Найденые пользователи ...
Разблокировать пользователей ...
Читали форум (0):
Пользователи онлайн (0):
x
x
Закрыть


Просмотр
0 / 0
Close
Debug Console [Select Text]