Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using a variable as the size argument when creating an array 1

Status
Not open for further replies.

snowneil

Programmer
Mar 22, 2006
40
GB
I am trying to do the below in part of my function..
keep getting

error '800a0402
Argument type must be an integer.

I heard you can't use variables as an argument for creating arrays in vbscript, anyone know any different? or a way around?

Code:
Function displayRandomKeyProducts(rsJ, argProdCount)

	intProdCount = Cint(argProdCount)
	Dim aryProducts(intProdCount)

 
[tt] intProdCount = Cint(argProdCount)
Dim aryProducts[red]()[/red]
[blue]redim aryProducts(intProdCount)[/blue][/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top