title: Trouble with ScriptControl's Eval method
body: <p>I got some maintenance tasks on an quite old Classic ASP web application and I'm kinda clueless when it comes to VBScript...</p>
  
  <p>I wonder if it is possible to set the value of a variable using the Eval method of a MSScriptControl.ScriptControl object. Also note that using the AddCode method of ScriptControl before calling Eval() is not an option given the circumstances.
  Here is some sample code demonstrating the problem:</p>
  
  <pre><code>Dim so,rs,someVar
  set someVar=...
  set so=server.CreateObject("MSScriptControl.ScriptControl")
  so.Language = "VBScript"
  so.AllowUI = False
  so.AddObject "someVar",someVar
  
  ' I get a syntax error here
  rs = so.Eval(scrObject.Eval("set someVar = Nothing" &amp; "set someVar = CreateObject("+Chr(34)+"Wscript.Shell"+Chr(34)+")" &amp; "response.write(someVar.CurrentDirectory)"))
  
  ' if I try something like this I get a syntax error as well..
  rs = so.Eval("Dim someVar2 : someVar2="+Chr(34)+"test"+Chr(34)+" : response.write(someVar2)")
  </code></pre>
  
  <p>I know that Eval method is meant for evaluating expressions, and expressions are not the most reasonable place for declaring or setting the values of variables, but I am wondering if it's still possible somehow.</p>
  
  <p>Your help is greatly appreciated.</p>