Dynamic Variable Naming

Results 1 to 2 of 2

Thread: Dynamic Variable Naming

  1. #1
    Richard Orchards Guest

    Default Dynamic Variable Naming

    Hi,<BR><BR>What i am trying to do is run a loop and assign variable names dynamically, so that i can call the contents of the variale anywhere.<BR><BR>An example<BR><BR>for i = 1 to 20 <BR><BR>banner(i) = avalue(i)<BR><BR>next<BR><BR>--then somewhere else<BR><BR>resonse.write banner1<BR><BR>further down the page<BR><BR>response.write banner2<BR><BR>any thoughts of suggestions would be appreciated!<BR><BR>Richard<BR>

  2. #2
    Ryne Guest

    Default RE: Dynamic Variable Naming

    Using array. <BR>e.g. :<BR>dim banner(),avalue()<BR>maxarray = 19 &#039make array from index 0 to 19<BR>redim banner(maxarray)<BR>redim avalue(maxarray)<BR>for i = 0 to maxarray<BR> banner(i) = avalue(i)<BR>next<BR>response.write banner(0)<BR>response.write banner(1)<BR>&#039etc.<BR>I hope that&#039s what you mean ...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts