Foros del Web » Programando para Internet » ASP Clásico »

Error al redimensionar un array

Estas en el tema de Error al redimensionar un array en el foro de ASP Clásico en Foros del Web. Hola, tengo el siguiente codigo: Dim Productos(0,6) actual = UBound(productos,1) Productos (actual,0) = RsPresu.Fields.Item("Referencia").Value actual = UBound(Productos,1)+1 redim preserve Productos(actual,6) y me dice El subíndice ...
  #1 (permalink)  
Antiguo 12/03/2002, 07:06
 
Fecha de Ingreso: noviembre-2001
Mensajes: 121
Antigüedad: 23 años, 6 meses
Puntos: 0
Error al redimensionar un array

Hola, tengo el siguiente codigo:
Dim Productos(0,6)

actual = UBound(productos,1)

Productos (actual,0) = RsPresu.Fields.Item("Referencia").Value

actual = UBound(Productos,1)+1

redim preserve Productos(actual,6)

y me dice El subíndice está fuera del intervalo

me podeis ayudar, por favor? :(
  #2 (permalink)  
Antiguo 12/03/2002, 07:33
 
Fecha de Ingreso: enero-2002
Mensajes: 120
Antigüedad: 23 años, 4 meses
Puntos: 0
Re: Error al redimensionar un array

Me parece recordar que no se puede usar el preserve con un array de dos dimensiones :-p :-p
  #3 (permalink)  
Antiguo 12/03/2002, 10:49
 
Fecha de Ingreso: diciembre-2001
Mensajes: 150
Antigüedad: 23 años, 4 meses
Puntos: 1
Re: Error al redimensionar un array

Hola Isabel:

Segun Microsoft:

ReDim releases the existing array and creates a new array with the same rank. The elements of the new array are initialized to the default value for their data type unless you specify Preserve.

If you include the Preserve keyword, Visual Basic copies the elements from the existing array to the new array. When you use Preserve, you can resize only the last dimension of the array , and for every other dimension you must specify the same size it already has in the existing array.

For example, if your array has only one dimension, you can resize that dimension and still preserve the contents of the array, 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 if you use Preserve .

Lamento darte malas noticias

Korrikalari
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 07:47.