[thelist] returning an array in vbscript

Lonnie Kraemer lwkraemer at earthlink.net
Thu Jan 23 16:47:02 CST 2003

> here is my code that doesn't work, but is what i want to do. i have
> looking around teh intarweb for the past hour trying to find an answer
> with no luck.
> Function returnArr(input)
> theArr = Split(input,"/")
> reurnArr = theArr
> End Function
> then in my page i want to do this...
> returnedArr = returnArr("1/2/3/4/5/6/7/8/9")
> Response.Write(returnedArr(0))
> Response.Write(returnedArr(1))
> Response.Write(returnedArr(2))
> Response.Write(returnedArr(3))
> etc...
> but of course i get an error message "Type mismatch: 'myArr'" on line
> which happens to be "Response.Write(returnedArr(0))".

You have:
returnArr() 'function
theArr= 'local variable
reurnArr= 'function return

then ask for:
returnedArr(#) 'spelled differently than the function

then an error for:
myArr 'who knows where that came from

Could it be a naming problem?

More information about the thelist mailing list