smus 1 Posted October 19, 2018 Report 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? Quote Link to post Share on other sites
justsomeguy 1,135 Posted October 19, 2018 Report Share Posted October 19, 2018 You can use redim to set a different length. Quote Link to post Share on other sites
smus 1 Posted October 20, 2018 Author Report 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 Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.