
Passing Arrays from Sub to Program
Hello,
I have a Main Program where I defined the variables. One of this
variable is a multidimensional array. I call a Sub where I add the items to
the Array, but when I try to write the items from the Array I can't.
I write the items from the Sub and I do it correctly but from the Main
Program not.
Can anyone help me?
The code in the Sub is:
If (rsConsultaProductos("PR_Precio") <> rsLineasPedido("LI_PrecioU")) then
LineasCambioPrecio (Columna, FilaLineasCambioPrecio) =
rsLineasPedido("LI_IdLinea")
Response.Write (LineasCambioPrecio(columna,FilaLineasCambioPrecio) &
"<br>")
Columna = Columna + 1
LineasCambioPrecio (Columna, FilaLineasCambioPrecio) =
rsConsultaProductos("PR_PrecioOferta")
Response.Write (LineasCambioPrecio(columna,FilaLineasCambioPrecio) &
"<br>")
FilaLineasCambioPrecio = FilaLineasCambioPrecio + 1
Redim LineasCambioPrecio (Columna, FilaLineasCambioPrecio)
Validar = 4
End If
And in the main program:
for columna = 0 to ubound(LineasCambioPrecio,1)
for fila = 0 to ubound(LineasCambioPrecio,2)
Response.Write ("columna= " & columna & "fila=" & fila &
LineasCambioPrecio(columna, fila) & "<br>")
next
next
I defined the array in the main program (I think it's a global variable, not
a local variable).
Thank you very much