Variable to Variable ??????

Results 1 to 2 of 2

Thread: Variable to Variable ??????

  1. #1
    Egang Guest

    Default Variable to Variable ??????

    I have a problem about variable. I want to make a variable named from another variable value, please somebody help me :<BR><BR>dim arr(5)<BR>for i = 0 to 4<BR> arr(i) = "EGANG"<BR>next<BR>For i = 1 to UBound(arr)<BR> response.Write(arr(i))<BR><BR> &#039;THE PROBLEM IS IN HERE<BR> "&arr(i)&" = "True"<BR> &#039;I WANT TO MAKE A VARIABLE NAME "EGANG" AND THE VALUE IS "TRUE"<BR> &#039;BUT IT WON&#039;T WORK, PLEASE HELP ME!!! Thank you<BR><BR>Next<BR><BR>

  2. #2
    Join Date
    Dec 1969

    Default It is a VERY VERY BAD idea...

    ...and almost SURELY means that you are not using VBScript in the best way.<BR><BR>But if you *MUST* do it:<BR><BR>&#060;%<BR>...<BR>Execute( arr(i) & " = True" )<BR>...<BR>%&#062;<BR><BR>That will do the same as<BR>&nbsp; &nbsp; EGANG = True<BR><BR>If you really wanted a string "True" instead of a boolean value, then you would need:<BR>&#060;%<BR>...<BR>Execute( arr(i) & " = ""True""" )<BR>...<BR>%&#062;<BR><BR>NOTE: Execute is only available in VBS version 5 and above.<BR><BR>***PLEASE*** try to find SOME OTHER WAY to do this. Almost surely you are coding something poorly.<BR><BR>

Posting Permissions

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