smus Posted October 19, 2018 Share Posted October 19, 2018 I would like to create an array with 2 elements, for example. When I assign the length explicitly, it works well, but this code does not work: dim n=2 dim a(n) a(0) = "first" a(1) = "second" response.write a(0)&a(1) how to set array length dynamically? Link to comment Share on other sites More sharing options...
justsomeguy Posted October 19, 2018 Share Posted October 19, 2018 You can use redim to set a different length. Link to comment Share on other sites More sharing options...
smus Posted October 20, 2018 Author Share Posted October 20, 2018 14 hours ago, justsomeguy said: You can use redim to set a different length. a() redim a(n) now it works, thanks Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now