|
it
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Script from variablesIf I put a line of VBScript into a variable, is it possible to execute/process that line of Script. I want to do something like: ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' For Each item In Request.Form cVBScriptLine = "c" & item & " = Request.Form(""" & item & """)" ''The next Line proves to me that I have got the correct ScriptLine Response.Write (cVBScriptLine & "<br>") '' I want to Execute?Process cVBScriptLine '' Wondered if Eval might do it '' It does not throw an Error but it does not do it !! Eval( cVBScriptLine ) Next ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' Where I have loads of data appearing, it will save me mountains of typing like cTopRow = Request.Form("TopRow") etc etc In other languages, I seenm to remember that it is called "substitution" !!! Thanks in anticipation Pete (Northolt UK) p byers wrote:
> Hi The command you are looking for is called Execute. Having said that, read > If I put a line of VBScript into a variable, is it possible to > execute/process that line of Script. > these (especially the secod if you are doing this in server-side script) before travelling too much further down this path: http://blogs.gotdotnet.com/ericli/PermaLink.aspx/5f27ae83-ff82-4fea-97db-b6fef3922c3b http://blogs.msdn.com/ericlippert/archive/2003/11/04/53335.aspx -- Microsoft MVP - ASP/ASP.NET - 2004-2007 Please reply to the newsgroup. This email account is my spam trap so I don't check it very often. If you must reply off-line, then remove the "NO SPAM" Bob Barrows wrote:
Show quoteHide quote > p byers wrote: Thank you Bob> > Hi > > If I put a line of VBScript into a variable, is it possible to > > execute/process that line of Script. > > > The command you are looking for is called Execute. Having said that, read > these (especially the secod if you are doing this in server-side script) > before travelling too much further down this path: > > http://blogs.gotdotnet.com/ericli/PermaLink.aspx/5f27ae83-ff82-4fea-97db-b6fef3922c3b > http://blogs.msdn.com/ericlippert/archive/2003/11/04/53335.aspx > > -- > Microsoft MVP - ASP/ASP.NET - 2004-2007 > Please reply to the newsgroup. This email account is my spam trap so I > don't check it very often. If you must reply off-line, then remove the > "NO SPAM" I will follow the links that you provided However, for my immediate neds, I looked at the WebPage and saw the lines produced by the "Response.Write" Put them into the Clipboard and pasted them int the script. Bit of lateral thinking !! lol Pete (Northolt UK) Bob Barrows wrote:
Show quoteHide quote > p byers wrote: Bob,> > Hi > > If I put a line of VBScript into a variable, is it possible to > > execute/process that line of Script. > > > The command you are looking for is called Execute. Having said that, read > these (especially the secod if you are doing this in server-side script) > before travelling too much further down this path: > > http://blogs.gotdotnet.com/ericli/PermaLink.aspx/5f27ae83-ff82-4fea-97db-b6fef3922c3b > http://blogs.msdn.com/ericlippert/archive/2003/11/04/53335.aspx > > -- > Microsoft MVP - ASP/ASP.NET - 2004-2007 > Please reply to the newsgroup. This email account is my spam trap so I > don't check it very often. If you must reply off-line, then remove the > "NO SPAM" The first link no longer exists. I understand the warning in the second link in front of the "for each" loop in my OP, there is another "for each" loop that validates the input as valid based on the start of the Data Item name So I feel fairly safe - famous last words !!! Now I will investigate the "Execute" command Thanks again Pete (Northolt UK) p byers wrote:
Show quoteHide quote > Bob Barrows wrote: It exists - you just have to google it:> >> p byers wrote: >>> Hi >>> If I put a line of VBScript into a variable, is it possible to >>> execute/process that line of Script. >>> >> The command you are looking for is called Execute. Having said that, >> read >> these (especially the secod if you are doing this in server-side >> script) >> before travelling too much further down this path: >> >> http://blogs.gotdotnet.com/ericli/PermaLink.aspx/5f27ae83-ff82-4fea-97db-b6fef3922c3b >> http://blogs.msdn.com/ericlippert/archive/2003/11/04/53335.aspx >> > > Bob, > > The first link no longer exists. > http://blogs.msdn.com/ericlippert/archive/2003/11/01/53329.aspx But you'll probably ignore ths one, too ... ;-) -- Microsoft MVP - ASP/ASP.NET - 2004-2007 Please reply to the newsgroup. This email account is my spam trap so I don't check it very often. If you must reply off-line, then remove the "NO SPAM"
Other interesting topics
LEFT JOIN problem
How can I type in the combo box <select> ? How to change all relative paths in a website??? What is the real IP address of the site visitor? Pinpoint unspecified error for objXMLHttp.send objXML statement ASP 0126 Select INTO, UNION Classic ASP, <SELECT> postback, Browser Navigation Microsoft OLE DB Provider for ODBC Drivers error '80004005' Problem with Instr to find a space |
|||||||||||||||||||||||