Converting a string into a variable

Results 1 to 2 of 2

Thread: Converting a string into a variable

  1. #1
    Marc Archambault Guest

    Default Converting a string into a variable

    How do we do this? Other than the obvious which is y = ab<BR>We want y = "c"<BR><BR>&#060;%<BR>ab = "c"<BR>y = "a" + "b"<BR>Response.Write ("This is the value of y = " & y)<BR>%&#062;<BR>

  2. #2
    Join Date
    Dec 1969

    Default Check out the Eval function

    VBScript (version 5.0 and up) contains a nifty little function called Eval that evaluates a string as a line of code and returns the result. You could do something like:<BR><BR>&#060;%<BR> ab = "c"<BR> y = "ab"<BR> Response.Write("The value of y is " & Eval(y))<BR>%&#062;<BR><BR>For more information check out:<BR><BR>Using the Eval and Execute Functions <BR><BR><BR>Happy Programming!

Posting Permissions

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