<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Armswiper.co.uk &#187; VBScript</title>
	<atom:link href="http://www.armswiper.co.uk/blog/view/tag/vbscript/feed" rel="self" type="application/rss+xml" />
	<link>http://www.armswiper.co.uk</link>
	<description>Developer, Rower, Funny Man</description>
	<lastBuildDate>Thu, 07 Apr 2011 19:18:45 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Attaching Microsoft Script Debugger to a Running Process</title>
		<link>http://www.armswiper.co.uk/blog/view/661</link>
		<comments>http://www.armswiper.co.uk/blog/view/661#comments</comments>
		<pubDate>Thu, 07 Oct 2010 18:31:44 +0000</pubDate>
		<dc:creator>Mark</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[debugging]]></category>
		<category><![CDATA[Internet Explorer]]></category>
		<category><![CDATA[VBScript]]></category>

		<guid isPermaLink="false">http://www.armswiper.co.uk/?p=661</guid>
		<description><![CDATA[OK, I&#8217;ve just learnt how to do something that I&#8217;m going to find very useful in the future! I&#8217;ve wanted to do this for a while and didn&#8217;t know, but necessity is the mother of invention (or investigation in this case.) Here&#8217;s the scenario. I have a running Internet Explorer session connected to a Live [...]]]></description>
			<content:encoded><![CDATA[<p>OK, I&#8217;ve just learnt how to do something that I&#8217;m going to find very useful in the future! I&#8217;ve wanted to do this for a while and didn&#8217;t know, but necessity is the mother of invention (or investigation in this case.)</p>
<p>Here&#8217;s the scenario. I have a running Internet Explorer session connected to a Live environment. I cannot change the Live code to add in a &#8220;Stop&#8221; statement. That Internet Explorer session is actually a hosted version of the IE ActiveX control inside of a custom executable. I have a VBScript bug and I need to see what&#8217;s happening.</p>
<p>So, what I need to do is to attached Microsoft Script Debugger (MSD) to the running IE session, and force a breakpoint in the code. Here&#8217;s how&#8230;.</p>
<ol>
<li>Start MSD.</li>
<li>Go to &#8220;Debug&#8221; -&gt; &#8220;Processes&#8221;.</li>
<li>Find the appropriate process, use the &#8220;Title&#8221; column to help.</li>
<li>Click &#8220;Attach&#8221;.</li>
<li>When the &#8220;Attach to Process&#8221; screen is displayed, click &#8220;OK&#8221;.</li>
<li>Click &#8220;Close&#8221;</li>
</ol>
<p>That will now attach you to the correct process. All you need to do now is to add a break point.</p>
<ol>
<li>Go to &#8220;Debug&#8221; -&gt; &#8220;New Breakpoint&#8221;</li>
<li>Type in the name of a function, sub-routine or event that you want to trap.</li>
<li>Perform the actions in IE that would cause the function where you inserted the breakpoint to fire.</li>
<li>You should then be directed to MSD with the source code of the lines where you inserted the break point.</li>
<li>Step-Over, Out-of or Into as much as you&#8217;d like!</li>
</ol>
<p>Simple really &#8211; just needed five minutes of Googling and playing around in MSD!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.armswiper.co.uk/blog/view/661/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>VBScript function IsNumeric</title>
		<link>http://www.armswiper.co.uk/blog/view/548</link>
		<comments>http://www.armswiper.co.uk/blog/view/548#comments</comments>
		<pubDate>Tue, 18 Aug 2009 09:29:44 +0000</pubDate>
		<dc:creator>Mark</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Work]]></category>
		<category><![CDATA[IsNumeric]]></category>
		<category><![CDATA[MSDN]]></category>
		<category><![CDATA[Stupid]]></category>
		<category><![CDATA[VBScript]]></category>

		<guid isPermaLink="false">http://www.armswiper.co.uk/?p=548</guid>
		<description><![CDATA[Brilliant. Last night, we discovered that the VBScript function &#8220;IsNumeric&#8221; is a little more clever than you&#8217;d like, but there&#8217;s also no simpler version either. Consider the following scenario. We have the user input in a bit of text on screen. We need to process that (client-side), and part of that processing needs to find [...]]]></description>
			<content:encoded><![CDATA[<p>Brilliant.</p>
<p>Last night, we discovered that the VBScript function &#8220;IsNumeric&#8221; is a little more clever than you&#8217;d like, but there&#8217;s also no simpler version either.</p>
<p>Consider the following scenario.</p>
<p>We have the user input in a bit of text on screen. We need to process that (client-side), and part of that processing needs to find out if it is a number or not (i.e. if it&#8217;s a number, do this, otherwise, do that.)</p>
<p>Last night, we encountered a problem with the word &#8220;65d1&#8243; &#8211; clearly, it&#8217;s not a number (the &#8220;d&#8221; gives that away,) however, IsNumeric says that it is. If you CInt(&#8220;65d1&#8243;) you get 650. WTF?</p>
<p>A little more testing reveals the following:</p>
<pre>CInt("65d0")  =&gt; 65
CInt("65d1")  =&gt; 650
CInt("65d2")  =&gt; 6500
CInt("65d-1") =&gt; 6</pre>
<p>So obviously that &#8220;d&#8221; refers to &#8220;*(10 ^ following number)&#8221; &#8211; however, I can&#8217;t find a reference for that.</p>
<p>A bit of googling turns up <a href="http://icmpme.blogspot.com/2006/02/vbscript-isnumeric.asp">this page </a>, which shows that adding a space at the front doesn&#8217;t stop it from being classed as numeric.</p>
<p>The only real clue to what is going on is to read, <em>and interpret</em>, the <a href="http://msdn.microsoft.com/en-gb/library/ehs9h2x9%28VS.85%29.aspx">MSDN reference page</a> which states:</p>
<blockquote><p>Returns a Boolean value indicating whether an expression can be evaluated as a number.</p></blockquote>
<p>And there-in lies the answer &#8211; that expression can be <em>evaluated</em> as a number, not that it is a number.</p>
<p>Fortunately, there is an implementation listed on the first page which shows you an alternative way to get the job done.</p>
<p>I&#8217;m now wondering if there are other things that you can enter that will affect an number in that way. I tried</p>
<pre>CInt("6*5")</pre>
<p>but that just errored. I&#8217;m wondering whether &#8220;e&#8221; has a similar effect.</p>
<p><strong>Update</strong>: Yes, &#8220;e&#8221; (at first glance) appears to have an identical effect to &#8220;d&#8221;.</p>
<pre>CInt("65D1") =&gt; 650
CInt("65D1") =&gt; 6500
CInt("65E1") =&gt; 650
CInt("65E1") =&gt; 6500</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.armswiper.co.uk/blog/view/548/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Debugging Client-Side VBScript</title>
		<link>http://www.armswiper.co.uk/blog/view/525</link>
		<comments>http://www.armswiper.co.uk/blog/view/525#comments</comments>
		<pubDate>Tue, 04 Aug 2009 11:31:18 +0000</pubDate>
		<dc:creator>Mark</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Work]]></category>
		<category><![CDATA[debugging]]></category>
		<category><![CDATA[VBScript]]></category>

		<guid isPermaLink="false">http://www.armswiper.co.uk/?p=525</guid>
		<description><![CDATA[Having used client-side VBScript for years at work, I discovered the joys of the Microsoft Script Debugger several years ago. Unfortunately, until now, I&#8217;ve been unable to get the debugger to invoke when I desired (rather than having to wait for a crash!) Several times, I ran across web pages saying that you just type [...]]]></description>
			<content:encoded><![CDATA[<p>Having used client-side VBScript for years at work, I discovered the joys of the Microsoft Script Debugger several years ago. Unfortunately, until now, I&#8217;ve been unable to get the debugger to invoke when I desired (rather than having to wait for a crash!)</p>
<p>Several times, I ran across web pages saying that you just type &#8220;debugger&#8221; &#8211; however that only works with Javascript and not VBScript. I also found loads of references to Server-side debugger with ASP.Net &#8211; again that doesn&#8217;t work with client side.</p>
<p>But, finally, today I managed to find <a href="http://www.serverwatch.com/tutorials/article.php/1549761/Debugging-ClientServer-Side-Scripts.htm">an article</a> which actually explains the process, and marvellously, it&#8217;s not difficult and it&#8217;s (logically) a one liner.</p>
<p>So I can reveal that to invoke the debugger in client-side VBScript, all you type is&#8230;..</p>
<pre>stop</pre>
<p>Huzzah!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.armswiper.co.uk/blog/view/525/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
