Dynamic Variables ??

Results 1 to 2 of 2

Thread: Dynamic Variables ??

  1. #1
    Join Date
    Dec 1969

    Default Dynamic Variables ??

    I posted a messge on the messageboard a few days ago but unfortunatly the answer i got didn&#039;t work <BR>basically -<BR>dependning on the user input (a number) then it&#039;ll create x number of variables this is the code that was sent to me :<BR><BR>&#060;%<BR>dim womenthatsuck<BR>womenthatsuck =2<BR>for i = 1 to womenthatsuck<BR>varname &i = (i+1)<BR>next<BR>%&#062;<BR>&#060;%= varname1 %&#062;<BR>&#060;%= varname2 %&#062;<BR><BR>====End Code====<BR>This is the error :-<BR>Microsoft VBScript compilation error &#039;800a03ea&#039; <BR><BR>Syntax error <BR><BR>/mike/temp/test.asp, line 6 <BR><BR>varname &i = (i+1)<BR>--------^<BR><BR>

  2. #2
    Join Date
    Dec 1969

    Default Don't do it!

    You could use server.execute for this kind of action, but I strongly advise against it, check the FAQs or search this board and I&#039;m sure you&#039;ll find a lot of people that agree with me.<BR><BR>I think what you need is an array, check this http://www.aspfaqs.com/aspfaqs/ShowCategory.asp?CatID=1 for more information on arrays

Posting Permissions

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