<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>VBScript and JScript Don't Mix, at least in ASP</title><link>http://blogs.msdn.com/b/ericlippert/archive/2004/02/19/76438.aspx</link><description>A reader wrote me recently to describe a problem that I used to hear fairly often:
 
 
 
 
 I write ASP code using VBScript and a coworker of mine uses JScript. We were wondering if we could combine our code in ASP. However, it does not seem to be</description><dc:language>en-US</dc:language><generator>Telligent Evolution Platform Developer Build (Build: 5.6.50428.7875)</generator><item><title>How does Active Server Pages use the script engines?</title><link>http://blogs.msdn.com/b/ericlippert/archive/2004/02/19/76438.aspx#8963853</link><pubDate>Wed, 24 Sep 2008 20:02:58 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8963853</guid><dc:creator>Fabulous Adventures In Coding</dc:creator><description>&lt;p&gt;It's always struck me as a little bit odd that Active Server Pages, a web server, encourages developers to use VBScript and JScript to write server-side scripts. I mean, the whole point of a web server is that it produces complex strings as blindingly&lt;/p&gt;
&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8963853" width="1" height="1"&gt;</description></item><item><title>re: VBScript and JScript Don't Mix, at least in ASP</title><link>http://blogs.msdn.com/b/ericlippert/archive/2004/02/19/76438.aspx#6480385</link><pubDate>Fri, 23 Nov 2007 11:31:25 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:6480385</guid><dc:creator>PtrEx</dc:creator><description>&lt;p&gt;I don't using more script blocks prevents you from caching their compiled states. Let's say we have:&lt;/p&gt;
&lt;p&gt;&amp;lt;script language&amp;quot;VBScript&amp;quot; runat=&amp;quot;server&amp;quot;&amp;gt;&lt;/p&gt;
&lt;p&gt;WriteOut(sHeader)&lt;/p&gt;
&lt;p&gt;&amp;lt;/script&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;script language&amp;quot;JScript&amp;quot; runat=&amp;quot;server&amp;quot;&amp;gt;&lt;/p&gt;
&lt;p&gt;WriteOut(sContent)&lt;/p&gt;
&lt;p&gt;&amp;lt;/script&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;script language&amp;quot;VBScript&amp;quot; runat=&amp;quot;server&amp;quot;&amp;gt;&lt;/p&gt;
&lt;p&gt;WriteOut(sFooter)&lt;/p&gt;
&lt;p&gt;&amp;lt;/script&amp;gt;&lt;/p&gt;
&lt;p&gt;Why can't we create THREE engines, one per script block, CACHE their compiled states, and run them SEQUENTIALLY? Of course, in this case, 20 script blocks would turn to 20 engines, but that's the ASP programmer's problem. Why shouldn't the infrastructure ALLOW him combining different languages?&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=6480385" width="1" height="1"&gt;</description></item><item><title>re: VBScript and JScript Don't Mix, at least in ASP</title><link>http://blogs.msdn.com/b/ericlippert/archive/2004/02/19/76438.aspx#6460266</link><pubDate>Thu, 22 Nov 2007 01:28:59 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:6460266</guid><dc:creator>Eric Lippert</dc:creator><description>&lt;p&gt;&amp;gt; Why couldn't ASP act the same? Why can't it do it now?&lt;/p&gt;
&lt;p&gt;Because ASP and WSH (and Internet Explorer) have completely different compilation models. &amp;nbsp;When the first page request comes in for a page, ASP:&lt;/p&gt;
&lt;p&gt;* transforms the page into a series of script blocks&lt;/p&gt;
&lt;p&gt;* compiles each block into the appropriate engine&lt;/p&gt;
&lt;p&gt;* caches the compiled engine state&lt;/p&gt;
&lt;p&gt;* runs each engine, one after the other.&lt;/p&gt;
&lt;p&gt;When the second request comes in, ASP skips the first three steps and just does the last.&lt;/p&gt;
&lt;p&gt;ASP could do it the WSH/IE way, but it would have to recompile every page from scratch every time. That consumes time and memory, and ASP is designed for speed.&lt;/p&gt;
&lt;p&gt;With WSH/IE, there is no &amp;quot;second time&amp;quot;. Every time a script runs is the first time, so there is no reason whatsoever to try to eke out more performance by caching compiled state and deferring execution until all the state is known. WSH/IE simply compiles and runs each block as it sees it, rather than doing all the compilation first, then all the running.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=6460266" width="1" height="1"&gt;</description></item><item><title>re: VBScript and JScript Don't Mix, at least in ASP</title><link>http://blogs.msdn.com/b/ericlippert/archive/2004/02/19/76438.aspx#6460213</link><pubDate>Thu, 22 Nov 2007 01:19:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:6460213</guid><dc:creator>PtrEx</dc:creator><description>&lt;p&gt;How does (w/c)script implement execution of WSFs then?&lt;/p&gt;
&lt;p&gt;For instance, the following code is legitimate, and executes in order of writing:&lt;/p&gt;
&lt;p&gt;&amp;lt;job&amp;gt;&lt;/p&gt;
&lt;p&gt;	&amp;lt;script language=&amp;quot;VBScript&amp;quot;&amp;gt;&lt;/p&gt;
&lt;p&gt;		MsgBox &amp;quot;Hello, VBScript World!&amp;quot;&lt;/p&gt;
&lt;p&gt;	&amp;lt;/script&amp;gt;&lt;/p&gt;
&lt;p&gt;	&amp;lt;script language=&amp;quot;JScript&amp;quot;&amp;gt;&lt;/p&gt;
&lt;p&gt;		WScript.Echo('Hello, JScript World!');&lt;/p&gt;
&lt;p&gt;	&amp;lt;/script&amp;gt;&lt;/p&gt;
&lt;p&gt;	&amp;lt;script language=&amp;quot;VBScript&amp;quot;&amp;gt;&lt;/p&gt;
&lt;p&gt;		MsgBox &amp;quot;Hello, VBScript World, Again!&amp;quot;&lt;/p&gt;
&lt;p&gt;	&amp;lt;/script&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;/job&amp;gt;&lt;/p&gt;
&lt;p&gt;The same is true for Function calls too:&lt;/p&gt;
&lt;p&gt;&amp;lt;job&amp;gt;&lt;/p&gt;
&lt;p&gt;	&amp;lt;script language=&amp;quot;VBScript&amp;quot;&amp;gt;&lt;/p&gt;
&lt;p&gt;		Sub Func1(i)&lt;/p&gt;
&lt;p&gt;			If i = 1 Then&lt;/p&gt;
&lt;p&gt;				Func2()&lt;/p&gt;
&lt;p&gt;			Else&lt;/p&gt;
&lt;p&gt;				MsgBox(&amp;quot;At Last!&amp;quot;)&lt;/p&gt;
&lt;p&gt;			End If&lt;/p&gt;
&lt;p&gt;		End Sub&lt;/p&gt;
&lt;p&gt;	&amp;lt;/script&amp;gt;&lt;/p&gt;
&lt;p&gt;	&amp;lt;script language=&amp;quot;JScript&amp;quot;&amp;gt;&lt;/p&gt;
&lt;p&gt;		function JFunc(k) {&lt;/p&gt;
&lt;p&gt;			Func1(k)&lt;/p&gt;
&lt;p&gt;		}&lt;/p&gt;
&lt;p&gt;	&amp;lt;/script&amp;gt;&lt;/p&gt;
&lt;p&gt;	&amp;lt;script language=&amp;quot;VBScript&amp;quot;&amp;gt;&lt;/p&gt;
&lt;p&gt;		Sub Func2()&lt;/p&gt;
&lt;p&gt;			JFunc(2)&lt;/p&gt;
&lt;p&gt;		End Sub&lt;/p&gt;
&lt;p&gt;		JFunc(1)&lt;/p&gt;
&lt;p&gt;	&amp;lt;/script&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;/job&amp;gt;&lt;/p&gt;
&lt;p&gt;Why couldn't ASP act the same? Why can't it do it now?&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=6460213" width="1" height="1"&gt;</description></item><item><title>re: VBScript and JScript Don't Mix, at least in ASP</title><link>http://blogs.msdn.com/b/ericlippert/archive/2004/02/19/76438.aspx#2178406</link><pubDate>Wed, 18 Apr 2007 21:16:04 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:2178406</guid><dc:creator>dubrox</dc:creator><description>&lt;p&gt;I just wanted to thank Ricardo Araujo for his solution on expiration date with JScript, before knowing it i've been writing manually the correct date format... horrible!&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=2178406" width="1" height="1"&gt;</description></item><item><title>re: VBScript and JScript Don't Mix, at least in ASP</title><link>http://blogs.msdn.com/b/ericlippert/archive/2004/02/19/76438.aspx#584680</link><pubDate>Thu, 27 Apr 2006 04:52:05 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:584680</guid><dc:creator>intrader</dc:creator><description>We have been using mixed language scripting to good effect. What is possible:&lt;br&gt;1. Create objects from JScript classes&lt;br&gt;2. Call the methods onsce you do the appropriate set command in VBscript&lt;br&gt;3. Call function/procedures from mixed libraries.&lt;br&gt;&lt;br&gt;It is convenient to think of server-side script classes and client-side script classes from the same code base. For example a set of client-side vaslidators which are also used at the server.&lt;br&gt;&lt;br&gt;Or, model panels at the server and the client wtih the same code base.&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=584680" width="1" height="1"&gt;</description></item><item><title>re: VBScript and JScript Don't Mix, at least in ASP</title><link>http://blogs.msdn.com/b/ericlippert/archive/2004/02/19/76438.aspx#87733</link><pubDate>Thu, 11 Mar 2004 05:19:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:87733</guid><dc:creator>skorn2k</dc:creator><description>Why move to C#? What's so special about it?&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=87733" width="1" height="1"&gt;</description></item><item><title>Uploading and Processing using IHttpAsyncHandler</title><link>http://blogs.msdn.com/b/ericlippert/archive/2004/02/19/76438.aspx#86200</link><pubDate>Mon, 08 Mar 2004 22:39:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:86200</guid><dc:creator>Grahame Horner</dc:creator><description>I've come across a number of issues when using IHttpAsyncHandlers, When trying to using HttpAsyncHandlers with ThreadPools the HttpRequest.Files.Count always returns 0 regardless of the number of file posted by the form.&lt;br&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=86200" width="1" height="1"&gt;</description></item><item><title>VBScript and JScript Mix ( but JScript rules :)</title><link>http://blogs.msdn.com/b/ericlippert/archive/2004/02/19/76438.aspx#81526</link><pubDate>Sat, 28 Feb 2004 18:45:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:81526</guid><dc:creator>Ricardo Araujo</dc:creator><description>Hehe;&lt;br&gt;&lt;br&gt;Ok, my 2.1 cents.&lt;br&gt;&lt;br&gt;I Use Jscript for both client and server site. An old school, not object oriented, coworker of mine uses VBscript.&lt;br&gt;&lt;br&gt;When I came to the team I found many of his work in use. I rewrote some and some I prefered keep as is due to retro-compatibility issues and lazyness.&lt;br&gt;&lt;br&gt;The way we can make it work is simple, lybraries. All your VB work must be procs and functions that you include in your pages and you call it from any part of your pages as func().&lt;br&gt;&lt;br&gt;Once your library is compiled the calls to the functions will work in the correct points where you put them.&lt;br&gt;&lt;br&gt;The only problem you can find is exchanging Arrays, avoid them. It can be done but needs conversion (you must write) and is CPU consumming.&lt;br&gt;&lt;br&gt;In response to Dave Anderson:&lt;br&gt;Response.Cookies(&amp;quot;myCookie&amp;quot;).expires=expireDate.getVarDate();&lt;br&gt;&lt;br&gt;In the future forget VBS and JS, let's move to C#&lt;br&gt;&lt;br&gt;See ya, :)&lt;br&gt;&lt;br&gt;Rick.&lt;br&gt;&lt;br&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=81526" width="1" height="1"&gt;</description></item><item><title>VBScript and JScript mix just fine in ASP</title><link>http://blogs.msdn.com/b/ericlippert/archive/2004/02/19/76438.aspx#79215</link><pubDate>Tue, 24 Feb 2004 16:54:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:79215</guid><dc:creator>Dave Anderson</dc:creator><description>There is no reason not to mix scripting languages in ASP. I have found it quite useful at times (ever try setting a cookie expiration with a JScript date?). It's important, of course, to encapsulate all cross-language segments in functions/Functions/Subs. This effectively eliminates the &amp;quot;order of execution&amp;quot; problem.&lt;br&gt;&lt;br&gt;&lt;a target="_new" href="http://msdn.microsoft.com/library/en-us/dnvid/html/msdn_vbnjscrpt.asp?frame=true#vbnjscrpt_working"&gt;http://msdn.microsoft.com/library/en-us/dnvid/html/msdn_vbnjscrpt.asp?frame=true#vbnjscrpt_working&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=79215" width="1" height="1"&gt;</description></item></channel></rss>