In VB6, the DIM is executed when the procedure starts (and does not depend on the place where the line is in the procedure).
You should do this:
Dim arrayPortas()
instrucaoQuantidadePortas = "SELECT QUANTIDADEPORTAS FROM CLIENTES WHERE CLIENTES.CODCLIENTE = 1"
set rsQuantidadePortas = vgoConn.Execute(instrucaoQuantidadePortas)
ReDim arrayPortas(rsQuantidadePortas("quantidadePortas"))
>Hi,
>
>i would like to create a dinamic Array and i´m trying to use the follow code:
>
>...
>instrucaoQuantidadePortas = "SELECT QUANTIDADEPORTAS FROM CLIENTES WHERE CLIENTES.CODCLIENTE = 1"
>set rsQuantidadePortas = vgoConn.Execute(instrucaoQuantidadePortas)
>Dim arrayPortas(rsQuantidadePortas("quantidadePortas"))
>
>but the compiler shows me the follow error message
>
>int const expected
>
>What is wrong in my code?
>
>thanks
>
>Anderson Girardi
Éric Moreau, MCPD, Visual Developer - Visual Basic MVP
Conseiller Principal / Senior Consultant
Moer inc.
http://www.emoreau.com