<?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>Classifieds Scripts, Web Scripts,  Ajax Scripts, PHP Scripts, ASP Scripts</title>
	<atom:link href="http://www.scriptclassifieds.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.scriptclassifieds.com</link>
	<description>AJAX, PHP Scripts, ASP Scripts, Ad Management, Bookmark Management, Database Tools, Chat Scripts, HTML Editors, Classified Ads Scripts, Classifieds Script</description>
	<lastBuildDate>Tue, 08 May 2012 08:21:32 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>VBScript Procedures</title>
		<link>http://www.scriptclassifieds.com/vbscript/vbscript-procedures/</link>
		<comments>http://www.scriptclassifieds.com/vbscript/vbscript-procedures/#comments</comments>
		<pubDate>Tue, 08 May 2012 08:21:32 +0000</pubDate>
		<dc:creator>thanhlangtu</dc:creator>
				<category><![CDATA[VBScript]]></category>
		<category><![CDATA[VBScrip.t Procedures]]></category>

		<guid isPermaLink="false">http://www.scriptclassifieds.com/?p=1205</guid>
		<description><![CDATA[VBScript has two kinds procedures: Sub procedure Function procedure &#160; VBScript Sub Procedures A Sub procedure: is a series of statements, enclosed by the Sub and End Sub statements can perform actions, but does not return a value can take arguments without arguments, it must include an empty set of parentheses () Sub mysub() some statements End [...]]]></description>
			<content:encoded><![CDATA[<p>VBScript has two kinds procedures:</p>
<ul>
<li>Sub procedure</li>
<li>Function procedure</li>
</ul>
<p>&nbsp;</p>
<hr />
<h2>VBScript Sub Procedures</h2>
<p>A Sub procedure:</p>
<ul>
<li>is a series of statements, enclosed by the Sub and End Sub statements</li>
<li>can perform actions, but <strong>does not return</strong> a value</li>
<li>can take arguments</li>
<li>without arguments, it must include an empty set of parentheses ()</li>
</ul>
<div>
<div>Sub mysub()<br />
<em>some statements</em><br />
End Sub</div>
</div>
<p>or</p>
<div>
<div>Sub mysub(argument1,argument2)<br />
<em>some statements</em><br />
End Sub</div>
</div>
<p>&nbsp;</p>
<div>
<h2>Example (IE Only)</h2>
<div>Sub mysub()<br />
alert(&#8220;Hello World&#8221;)<br />
End Sub</div>
<p><a href="http://www.w3schools.com/vbscript/tryit.asp?filename=vbdemo_subex" target="_blank">Try it yourself »</a></div>
<h2>VBScript Function Procedures</h2>
<p>A Function procedure:</p>
<ul>
<li>is a series of statements, enclosed by the Function and End Function statements</li>
<li>can perform actions and <strong>can return</strong> a value</li>
<li>can take arguments that are passed to it by a calling procedure</li>
<li>without arguments, must include an empty set of parentheses ()</li>
<li>returns a value by assigning a value to its name</li>
</ul>
<div>
<div>Function myfunction()<br />
<em>some statements</em><br />
myfunction=<em>some value</em><br />
End Function</div>
</div>
<p>or</p>
<div>
<div>Function myfunction(argument1,argument2)<br />
<em>some statements</em><br />
myfunction=<em>some value</em><br />
End Function</div>
</div>
<p>&nbsp;</p>
<div>
<h2>Example (IE Only)</h2>
<div>function myfunction()<br />
myfunction=Date()<br />
end function</div>
<p><a href="http://www.w3schools.com/vbscript/tryit.asp?filename=vbdemo_functionex" target="_blank">Try it yourself »</a></div>
<h2>How to Call a Procedure</h2>
<p>There are different ways to call a procedure. You can call it from within another procedure, on an event, or call it within a script.</p>
<div>
<h2>Example (IE Only)</h2>
<p>Call a procedure when the user clicks on a button:</p>
<div>&lt;body&gt;<br />
&lt;button onclick=&#8221;myfunction()&#8221;&gt;Click me&lt;/button&gt;<br />
&lt;/body&gt;</div>
<p><a href="http://www.w3schools.com/vbscript/tryit.asp?filename=vbdemo_proc_event" target="_blank">Try it yourself »</a></div>
<p>Procedures can be used to get a variable value:</p>
<div>
<div>carname=findname()</div>
</div>
<p>Here you call a Function called &#8220;findname&#8221;, the Function returns a value that will be stored in the variable &#8220;carname&#8221;.</p>
<p>Function procedures can calculate the sum of two arguments:</p>
<div>
<h2>Example (IE Only)</h2>
<div>Function myfunction(a,b)<br />
myfunction=a+b<br />
End Function</p>
<p>document.write(myfunction(5,9))</p></div>
<p><a href="http://www.w3schools.com/vbscript/tryit.asp?filename=vbdemo_proc_calc" target="_blank">Try it yourself »</a></div>
<p>The function &#8220;myfunction&#8221; will return the sum of argument &#8220;a&#8221; and argument &#8220;b&#8221;. In this case 14.</p>
<p>When you call a procedure you can use the Call statement, like this:</p>
<div>
<div>Call MyProc(argument)</div>
</div>
<p>Or, you can omit the Call statement, like this:</p>
<div>
<div>MyProc argument</div>
</div>
<p>source from: <a href="http://www.w3schools.com/">w3schools</a></p>



Share and Enjoy:


	<a rel="nofollow"  target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-procedures%2F&amp;title=VBScript%20Procedures&amp;bodytext=VBScript%20has%20two%20kinds%20procedures%3A%0D%0A%0D%0A%09Sub%20procedure%0D%0A%09Function%20procedure%0D%0A%0D%0A%26nbsp%3B%0D%0A%0D%0A%0D%0A%0D%0AVBScript%20Sub%20Procedures%0D%0AA%20Sub%20procedure%3A%0D%0A%0D%0A%09is%20a%20series%20of%20statements%2C%20enclosed%20by%20the%20Sub%20and%20End%20Sub%20statements%0D%0A%09can%20perform%20actions%2C%20but%C2%A0does%20not%20return" title="Digg"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" /></a>
	<a rel="nofollow"  target="_blank" href="http://sphinn.com/index.php?c=post&amp;m=submit&amp;link=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-procedures%2F" title="Sphinn"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/sphinn.png" title="Sphinn" alt="Sphinn" /></a>
	<a rel="nofollow"  target="_blank" href="http://delicious.com/post?url=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-procedures%2F&amp;title=VBScript%20Procedures&amp;notes=VBScript%20has%20two%20kinds%20procedures%3A%0D%0A%0D%0A%09Sub%20procedure%0D%0A%09Function%20procedure%0D%0A%0D%0A%26nbsp%3B%0D%0A%0D%0A%0D%0A%0D%0AVBScript%20Sub%20Procedures%0D%0AA%20Sub%20procedure%3A%0D%0A%0D%0A%09is%20a%20series%20of%20statements%2C%20enclosed%20by%20the%20Sub%20and%20End%20Sub%20statements%0D%0A%09can%20perform%20actions%2C%20but%C2%A0does%20not%20return" title="del.icio.us"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-procedures%2F&amp;t=VBScript%20Procedures" title="Facebook"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.mixx.com/submit?page_url=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-procedures%2F&amp;title=VBScript%20Procedures" title="Mixx"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/mixx.png" title="Mixx" alt="Mixx" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-procedures%2F&amp;title=VBScript%20Procedures&amp;annotation=VBScript%20has%20two%20kinds%20procedures%3A%0D%0A%0D%0A%09Sub%20procedure%0D%0A%09Function%20procedure%0D%0A%0D%0A%26nbsp%3B%0D%0A%0D%0A%0D%0A%0D%0AVBScript%20Sub%20Procedures%0D%0AA%20Sub%20procedure%3A%0D%0A%0D%0A%09is%20a%20series%20of%20statements%2C%20enclosed%20by%20the%20Sub%20and%20End%20Sub%20statements%0D%0A%09can%20perform%20actions%2C%20but%C2%A0does%20not%20return" title="Google Bookmarks"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.diigo.com/post?url=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-procedures%2F&amp;title=VBScript%20Procedures" title="Diigo"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/diigo.png" title="Diigo" alt="Diigo" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.dzone.com/links/add.html?url=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-procedures%2F&amp;title=VBScript%20Procedures" title="DZone"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/dzone.png" title="DZone" alt="DZone" /></a>
	<a rel="nofollow"  target="_blank" href="http://cgi.fark.com/cgi/fark/farkit.pl?h=VBScript%20Procedures&amp;u=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-procedures%2F" title="Fark"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/fark.png" title="Fark" alt="Fark" /></a>
	<a rel="nofollow"  target="_blank" href="http://faves.com/Authoring.aspx?u=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-procedures%2F&amp;title=VBScript%20Procedures" title="Faves"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/bluedot.png" title="Faves" alt="Faves" /></a>
	<a rel="nofollow"  target="_blank" href="http://laaik.it/NewStoryCompact.aspx?uri=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-procedures%2F&amp;headline=VBScript%20Procedures&amp;cat=5e082fcc-8a3b-47e2-acec-fdf64ff19d12" title="laaik.it"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/laaikit.png" title="laaik.it" alt="laaik.it" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-procedures%2F&amp;title=VBScript%20Procedures&amp;source=Classifieds+Scripts%2C+Web+Scripts%2C++Ajax+Scripts%2C+PHP+Scripts%2C+ASP+Scripts+AJAX%2C+PHP+Scripts%2C+ASP+Scripts%2C+Ad+Management%2C+Bookmark+Management%2C+Database+Tools%2C+Chat+Scripts%2C+HTML+Editors%2C+Classified+Ads+Scripts%2C+Classifieds+Script&amp;summary=VBScript%20has%20two%20kinds%20procedures%3A%0D%0A%0D%0A%09Sub%20procedure%0D%0A%09Function%20procedure%0D%0A%0D%0A%26nbsp%3B%0D%0A%0D%0A%0D%0A%0D%0AVBScript%20Sub%20Procedures%0D%0AA%20Sub%20procedure%3A%0D%0A%0D%0A%09is%20a%20series%20of%20statements%2C%20enclosed%20by%20the%20Sub%20and%20End%20Sub%20statements%0D%0A%09can%20perform%20actions%2C%20but%C2%A0does%20not%20return" title="LinkedIn"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" /></a>
	<a rel="nofollow"  target="_blank" href="https://favorites.live.com/quickadd.aspx?marklet=1&amp;url=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-procedures%2F&amp;title=VBScript%20Procedures" title="Live"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/live.png" title="Live" alt="Live" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.mister-wong.com/addurl/?bm_url=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-procedures%2F&amp;bm_description=VBScript%20Procedures&amp;plugin=soc" title="MisterWong"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/misterwong.png" title="MisterWong" alt="MisterWong" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.myspace.com/Modules/PostTo/Pages/?u=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-procedures%2F&amp;t=VBScript%20Procedures" title="MySpace"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/myspace.png" title="MySpace" alt="MySpace" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.netvibes.com/share?title=VBScript%20Procedures&amp;url=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-procedures%2F" title="Netvibes"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/netvibes.png" title="Netvibes" alt="Netvibes" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.netvouz.com/action/submitBookmark?url=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-procedures%2F&amp;title=VBScript%20Procedures&amp;popup=no" title="Netvouz"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/netvouz.png" title="Netvouz" alt="Netvouz" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.newsvine.com/_tools/seed&amp;save?u=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-procedures%2F&amp;h=VBScript%20Procedures" title="NewsVine"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/newsvine.png" title="NewsVine" alt="NewsVine" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.propeller.com/submit/?url=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-procedures%2F" title="Propeller"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/propeller.png" title="Propeller" alt="Propeller" /></a>
	<a rel="nofollow"  target="_blank" href="http://reddit.com/submit?url=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-procedures%2F&amp;title=VBScript%20Procedures" title="Reddit"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" /></a>
	<a rel="nofollow"  target="_blank" href="http://slashdot.org/bookmark.pl?title=VBScript%20Procedures&amp;url=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-procedures%2F" title="Slashdot"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/slashdot.png" title="Slashdot" alt="Slashdot" /></a>
	<a rel="nofollow"  target="_blank" href="http://socialogs.com/add_story.php?story_url=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-procedures%2F&amp;story_title=VBScript%20Procedures" title="Socialogs"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/socialogs.png" title="Socialogs" alt="Socialogs" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-procedures%2F&amp;title=VBScript%20Procedures" title="StumbleUpon"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" /></a>
	<a rel="nofollow"  target="_blank" href="http://technorati.com/faves?add=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-procedures%2F" title="Technorati"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" /></a>
	<a rel="nofollow"  target="_blank" href="http://twitter.com/home?status=VBScript%20Procedures%20-%20http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-procedures%2F" title="Twitter"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" /></a>
	<a rel="nofollow"  target="_blank" href="http://buzz.yahoo.com/submit/?submitUrl=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-procedures%2F&amp;submitHeadline=VBScript%20Procedures&amp;submitSummary=VBScript%20has%20two%20kinds%20procedures%3A%0D%0A%0D%0A%09Sub%20procedure%0D%0A%09Function%20procedure%0D%0A%0D%0A%26nbsp%3B%0D%0A%0D%0A%0D%0A%0D%0AVBScript%20Sub%20Procedures%0D%0AA%20Sub%20procedure%3A%0D%0A%0D%0A%09is%20a%20series%20of%20statements%2C%20enclosed%20by%20the%20Sub%20and%20End%20Sub%20statements%0D%0A%09can%20perform%20actions%2C%20but%C2%A0does%20not%20return&amp;submitCategory=science&amp;submitAssetType=text" title="Yahoo! Buzz"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/yahoobuzz.png" title="Yahoo! Buzz" alt="Yahoo! Buzz" /></a>


<br/><br/>]]></content:encoded>
			<wfw:commentRss>http://www.scriptclassifieds.com/vbscript/vbscript-procedures/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>VBScript Conditional Statements</title>
		<link>http://www.scriptclassifieds.com/vbscript/vbscript-conditional-statements/</link>
		<comments>http://www.scriptclassifieds.com/vbscript/vbscript-conditional-statements/#comments</comments>
		<pubDate>Tue, 08 May 2012 08:21:31 +0000</pubDate>
		<dc:creator>thanhlangtu</dc:creator>
				<category><![CDATA[VBScript]]></category>
		<category><![CDATA[Conditional]]></category>
		<category><![CDATA[Statements]]></category>

		<guid isPermaLink="false">http://www.scriptclassifieds.com/?p=1202</guid>
		<description><![CDATA[Conditional Statements Conditional statements are used to perform different actions for different decisions. In VBScript we have four conditional statements: If statement - executes a set of code when a condition is true If&#8230;Then&#8230;Else statement - select one of two sets of lines to execute If&#8230;Then&#8230;ElseIf statement - select one of many sets of lines to execute Select [...]]]></description>
			<content:encoded><![CDATA[<h2>Conditional Statements</h2>
<p>Conditional statements are used to perform different actions for different decisions.</p>
<p>In VBScript we have four conditional statements:</p>
<ul>
<li><strong>If statement</strong> - executes a set of code when a condition is true</li>
<li><strong>If&#8230;Then&#8230;Else statement</strong> - select one of two sets of lines to execute</li>
<li><strong>If&#8230;Then&#8230;ElseIf statement</strong> - select one of many sets of lines to execute</li>
<li><strong>Select Case statement</strong> - select one of many sets of lines to execute</li>
</ul>
<hr />
<h2>If&#8230;Then&#8230;Else</h2>
<p>Use the If&#8230;Then&#8230;Else statement if you want to</p>
<ul>
<li>execute some code if a condition is true</li>
<li>select one of two blocks of code to execute</li>
</ul>
<p>If you want to execute only <strong>one</strong> statement when a condition is true, you can write the code on one line:</p>
<div>
<div>If i=10 Then alert(&#8220;Hello&#8221;)</div>
</div>
<p>There is no ..Else.. in this syntax. You just tell the code to perform <strong>one action</strong> if a condition is true (in this case If i=10).</p>
<p>If you want to execute <strong>more than one</strong> statement when a condition is true, you must put each statement on separate lines, and end the statement with the keyword &#8220;End If&#8221;:</p>
<div>
<div>If i=10 Then<br />
alert(&#8220;Hello&#8221;)<br />
i = i+1<br />
End If</div>
</div>
<p>There is no ..Else.. in the example above either. You just tell the code to perform <strong>multiple actions</strong> if the condition is true.</p>
<p>If you want to execute a statement if a condition is true and execute another statement if the condition is not true, you must add the &#8220;Else&#8221; keyword:</p>
<div>
<h2>Example (IE Only)</h2>
<div>&lt;html&gt;<br />
&lt;body&gt;<br />
&lt;head&gt;<br />
&lt;script type=&#8221;text/vbscript&#8221;&gt;<br />
Function greeting()<br />
i=hour(time)<br />
If i &lt; 10 Then<br />
document.write(&#8220;Good morning!&#8221;)<br />
Else<br />
document.write(&#8220;Have a nice day!&#8221;)<br />
End If<br />
End Function<br />
&lt;/script&gt;<br />
&lt;/head&gt;</p>
<p>&lt;body onload=&#8221;greeting()&#8221;&gt;<br />
&lt;/body&gt;</p>
<p>&lt;/html&gt;</p></div>
<p><a href="http://www.w3schools.com/vbscript/tryit.asp?filename=vbdemo_ifthen" target="_blank">Try it yourself »</a></div>
<p>In the example above, the first block of code will be executed if the condition is true, and the other block will be executed otherwise (if i is greater than 10).</p>
<hr />
<h2>If&#8230;Then&#8230;ElseIf</h2>
<p>You can use the If&#8230;Then&#8230;ElseIf statement if you want to select one of many blocks of code to execute:</p>
<div>
<h2>Example (IE Only)</h2>
<div>&lt;html&gt;<br />
&lt;body&gt;<br />
&lt;head&gt;<br />
&lt;script type=&#8221;text/vbscript&#8221;&gt;<br />
Function greeting()<br />
i=hour(time)<br />
If i = 10 Then<br />
document.write(&#8220;Just started&#8230;!&#8221;)<br />
ElseIf i = 11 then<br />
document.write(&#8220;Hungry!&#8221;)<br />
ElseIf i = 12 then<br />
document.write(&#8220;Ah, lunch-time!&#8221;)<br />
ElseIf i = 16 then<br />
document.write(&#8220;Time to go home!&#8221;)<br />
Else<br />
document.write(&#8220;Unknown&#8221;)<br />
End If<br />
End Function<br />
&lt;/script&gt;<br />
&lt;/head&gt;</p>
<p>&lt;body onload=&#8221;greeting()&#8221;&gt;<br />
&lt;/body&gt;</p>
<p>&lt;/html&gt;</p></div>
<p><a href="http://www.w3schools.com/vbscript/tryit.asp?filename=vbdemo_elseif" target="_blank">Try it yourself »</a></div>
<p>&nbsp;</p>
<hr />
<h2>Select Case</h2>
<p>You can also use the &#8220;Select Case&#8221; statement if you want to select one of many blocks of code to execute:</p>
<div>
<h2>Example (IE Only)</h2>
<div>&lt;html&gt;<br />
&lt;body&gt;<br />
&lt;script type=&#8221;text/vbscript&#8221;&gt;<br />
d=weekday(date)<br />
Select Case d<br />
Case 1<br />
document.write(&#8220;Sleepy Sunday&#8221;)<br />
Case 2<br />
document.write(&#8220;Monday again!&#8221;)<br />
Case 3<br />
document.write(&#8220;Just Tuesday!&#8221;)<br />
Case 4<br />
document.write(&#8220;Wednesday!&#8221;)<br />
Case 5<br />
document.write(&#8220;Thursday&#8230;&#8221;)<br />
Case 6<br />
document.write(&#8220;Finally Friday!&#8221;)<br />
Case else<br />
document.write(&#8220;Super Saturday!!!!&#8221;)<br />
End Select<br />
&lt;/script&gt;</p>
<p>&lt;/body&gt;<br />
&lt;/html&gt;</p></div>
<p><a href="http://www.w3schools.com/vbscript/tryit.asp?filename=vbdemo_selectcase" target="_blank">Try it yourself »</a></div>
<p>This is how it works: First we have a single expression (most often a variable), that is evaluated once. The value of the expression is then compared with the values for each Case in the structure. If there is a match, the block of code associated with that Case is executed.</p>
<p>source from: <a href="http://www.w3schools.com/">w3schools</a></p>



Share and Enjoy:


	<a rel="nofollow"  target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-conditional-statements%2F&amp;title=VBScript%20Conditional%20Statements%20%20&amp;bodytext=Conditional%20Statements%0D%0AConditional%20statements%20are%20used%20to%20perform%20different%20actions%20for%20different%20decisions.%0D%0A%0D%0AIn%20VBScript%20we%20have%20four%20conditional%20statements%3A%0D%0A%0D%0A%09If%20statement%C2%A0-%20executes%20a%20set%20of%20code%20when%20a%20condition%20is%20true%0D%0A%09If...Then...Else%20s" title="Digg"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" /></a>
	<a rel="nofollow"  target="_blank" href="http://sphinn.com/index.php?c=post&amp;m=submit&amp;link=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-conditional-statements%2F" title="Sphinn"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/sphinn.png" title="Sphinn" alt="Sphinn" /></a>
	<a rel="nofollow"  target="_blank" href="http://delicious.com/post?url=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-conditional-statements%2F&amp;title=VBScript%20Conditional%20Statements%20%20&amp;notes=Conditional%20Statements%0D%0AConditional%20statements%20are%20used%20to%20perform%20different%20actions%20for%20different%20decisions.%0D%0A%0D%0AIn%20VBScript%20we%20have%20four%20conditional%20statements%3A%0D%0A%0D%0A%09If%20statement%C2%A0-%20executes%20a%20set%20of%20code%20when%20a%20condition%20is%20true%0D%0A%09If...Then...Else%20s" title="del.icio.us"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-conditional-statements%2F&amp;t=VBScript%20Conditional%20Statements%20%20" title="Facebook"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.mixx.com/submit?page_url=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-conditional-statements%2F&amp;title=VBScript%20Conditional%20Statements%20%20" title="Mixx"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/mixx.png" title="Mixx" alt="Mixx" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-conditional-statements%2F&amp;title=VBScript%20Conditional%20Statements%20%20&amp;annotation=Conditional%20Statements%0D%0AConditional%20statements%20are%20used%20to%20perform%20different%20actions%20for%20different%20decisions.%0D%0A%0D%0AIn%20VBScript%20we%20have%20four%20conditional%20statements%3A%0D%0A%0D%0A%09If%20statement%C2%A0-%20executes%20a%20set%20of%20code%20when%20a%20condition%20is%20true%0D%0A%09If...Then...Else%20s" title="Google Bookmarks"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.diigo.com/post?url=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-conditional-statements%2F&amp;title=VBScript%20Conditional%20Statements%20%20" title="Diigo"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/diigo.png" title="Diigo" alt="Diigo" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.dzone.com/links/add.html?url=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-conditional-statements%2F&amp;title=VBScript%20Conditional%20Statements%20%20" title="DZone"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/dzone.png" title="DZone" alt="DZone" /></a>
	<a rel="nofollow"  target="_blank" href="http://cgi.fark.com/cgi/fark/farkit.pl?h=VBScript%20Conditional%20Statements%20%20&amp;u=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-conditional-statements%2F" title="Fark"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/fark.png" title="Fark" alt="Fark" /></a>
	<a rel="nofollow"  target="_blank" href="http://faves.com/Authoring.aspx?u=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-conditional-statements%2F&amp;title=VBScript%20Conditional%20Statements%20%20" title="Faves"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/bluedot.png" title="Faves" alt="Faves" /></a>
	<a rel="nofollow"  target="_blank" href="http://laaik.it/NewStoryCompact.aspx?uri=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-conditional-statements%2F&amp;headline=VBScript%20Conditional%20Statements%20%20&amp;cat=5e082fcc-8a3b-47e2-acec-fdf64ff19d12" title="laaik.it"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/laaikit.png" title="laaik.it" alt="laaik.it" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-conditional-statements%2F&amp;title=VBScript%20Conditional%20Statements%20%20&amp;source=Classifieds+Scripts%2C+Web+Scripts%2C++Ajax+Scripts%2C+PHP+Scripts%2C+ASP+Scripts+AJAX%2C+PHP+Scripts%2C+ASP+Scripts%2C+Ad+Management%2C+Bookmark+Management%2C+Database+Tools%2C+Chat+Scripts%2C+HTML+Editors%2C+Classified+Ads+Scripts%2C+Classifieds+Script&amp;summary=Conditional%20Statements%0D%0AConditional%20statements%20are%20used%20to%20perform%20different%20actions%20for%20different%20decisions.%0D%0A%0D%0AIn%20VBScript%20we%20have%20four%20conditional%20statements%3A%0D%0A%0D%0A%09If%20statement%C2%A0-%20executes%20a%20set%20of%20code%20when%20a%20condition%20is%20true%0D%0A%09If...Then...Else%20s" title="LinkedIn"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" /></a>
	<a rel="nofollow"  target="_blank" href="https://favorites.live.com/quickadd.aspx?marklet=1&amp;url=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-conditional-statements%2F&amp;title=VBScript%20Conditional%20Statements%20%20" title="Live"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/live.png" title="Live" alt="Live" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.mister-wong.com/addurl/?bm_url=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-conditional-statements%2F&amp;bm_description=VBScript%20Conditional%20Statements%20%20&amp;plugin=soc" title="MisterWong"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/misterwong.png" title="MisterWong" alt="MisterWong" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.myspace.com/Modules/PostTo/Pages/?u=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-conditional-statements%2F&amp;t=VBScript%20Conditional%20Statements%20%20" title="MySpace"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/myspace.png" title="MySpace" alt="MySpace" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.netvibes.com/share?title=VBScript%20Conditional%20Statements%20%20&amp;url=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-conditional-statements%2F" title="Netvibes"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/netvibes.png" title="Netvibes" alt="Netvibes" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.netvouz.com/action/submitBookmark?url=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-conditional-statements%2F&amp;title=VBScript%20Conditional%20Statements%20%20&amp;popup=no" title="Netvouz"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/netvouz.png" title="Netvouz" alt="Netvouz" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.newsvine.com/_tools/seed&amp;save?u=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-conditional-statements%2F&amp;h=VBScript%20Conditional%20Statements%20%20" title="NewsVine"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/newsvine.png" title="NewsVine" alt="NewsVine" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.propeller.com/submit/?url=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-conditional-statements%2F" title="Propeller"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/propeller.png" title="Propeller" alt="Propeller" /></a>
	<a rel="nofollow"  target="_blank" href="http://reddit.com/submit?url=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-conditional-statements%2F&amp;title=VBScript%20Conditional%20Statements%20%20" title="Reddit"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" /></a>
	<a rel="nofollow"  target="_blank" href="http://slashdot.org/bookmark.pl?title=VBScript%20Conditional%20Statements%20%20&amp;url=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-conditional-statements%2F" title="Slashdot"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/slashdot.png" title="Slashdot" alt="Slashdot" /></a>
	<a rel="nofollow"  target="_blank" href="http://socialogs.com/add_story.php?story_url=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-conditional-statements%2F&amp;story_title=VBScript%20Conditional%20Statements%20%20" title="Socialogs"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/socialogs.png" title="Socialogs" alt="Socialogs" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-conditional-statements%2F&amp;title=VBScript%20Conditional%20Statements%20%20" title="StumbleUpon"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" /></a>
	<a rel="nofollow"  target="_blank" href="http://technorati.com/faves?add=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-conditional-statements%2F" title="Technorati"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" /></a>
	<a rel="nofollow"  target="_blank" href="http://twitter.com/home?status=VBScript%20Conditional%20Statements%20%20%20-%20http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-conditional-statements%2F" title="Twitter"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" /></a>
	<a rel="nofollow"  target="_blank" href="http://buzz.yahoo.com/submit/?submitUrl=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-conditional-statements%2F&amp;submitHeadline=VBScript%20Conditional%20Statements%20%20&amp;submitSummary=Conditional%20Statements%0D%0AConditional%20statements%20are%20used%20to%20perform%20different%20actions%20for%20different%20decisions.%0D%0A%0D%0AIn%20VBScript%20we%20have%20four%20conditional%20statements%3A%0D%0A%0D%0A%09If%20statement%C2%A0-%20executes%20a%20set%20of%20code%20when%20a%20condition%20is%20true%0D%0A%09If...Then...Else%20s&amp;submitCategory=science&amp;submitAssetType=text" title="Yahoo! Buzz"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/yahoobuzz.png" title="Yahoo! Buzz" alt="Yahoo! Buzz" /></a>


<br/><br/>]]></content:encoded>
			<wfw:commentRss>http://www.scriptclassifieds.com/vbscript/vbscript-conditional-statements/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>VBScript Looping</title>
		<link>http://www.scriptclassifieds.com/vbscript/vbscript-looping/</link>
		<comments>http://www.scriptclassifieds.com/vbscript/vbscript-looping/#comments</comments>
		<pubDate>Tue, 08 May 2012 08:21:29 +0000</pubDate>
		<dc:creator>thanhlangtu</dc:creator>
				<category><![CDATA[VBScript]]></category>
		<category><![CDATA[Looping]]></category>

		<guid isPermaLink="false">http://www.scriptclassifieds.com/?p=1203</guid>
		<description><![CDATA[Looping Statements Looping statements are used to run the same block of code a specified number of times. In VBScript we have four looping statements: For&#8230;Next statement - runs code a specified number of times For Each&#8230;Next statement - runs code for each item in a collection or each element of an array Do&#8230;Loop statement - loops while [...]]]></description>
			<content:encoded><![CDATA[<h2>Looping Statements</h2>
<p>Looping statements are used to run the same block of code a specified number of times.</p>
<p>In VBScript we have four looping statements:</p>
<ul>
<li><strong>For&#8230;Next statement </strong>- runs code a specified number of times</li>
<li><strong>For Each&#8230;Next statement </strong>- runs code for each item in a collection or each element of an array</li>
<li><strong>Do&#8230;Loop statement </strong>- loops while or until a condition is true</li>
<li><strong>While&#8230;Wend statement </strong>- Do not use it &#8211; use the Do&#8230;Loop statement instead</li>
</ul>
<hr />
<h2>For&#8230;Next Loop</h2>
<p>Use the <strong>For&#8230;Next</strong> statement to run a block of code a specified number of times.</p>
<p>The <strong>For</strong> statement specifies the counter variable (<strong>i</strong>), and its start and end values. The <strong>Next</strong>statement increases the counter variable (<strong>i</strong>) by one.</p>
<div>
<h2>Example</h2>
<div>&lt;html&gt;<br />
&lt;body&gt;</p>
<p>&lt;script type=&#8221;text/vbscript&#8221;&gt;<br />
For i = 0 To 5<br />
document.write(&#8220;The number is &#8221; &amp; i &amp; &#8220;&lt;br /&gt;&#8221;)<br />
Next<br />
&lt;/script&gt;</p>
<p>&lt;/body&gt;<br />
&lt;/html&gt;</p></div>
<p><a href="http://www.w3schools.com/vbscript/tryit.asp?filename=vbdemo_fornext" target="_blank">Try it yourself »</a></div>
<h3>The Step Keyword</h3>
<p>With the <strong>Step</strong> keyword, you can increase or decrease the counter variable by the value you specify.</p>
<p>In the example below, the counter variable (<strong>i</strong>) is INCREASED by two, each time the loop repeats.</p>
<div>
<div>For i=2 To 10 Step 2<br />
some code<br />
Next</div>
</div>
<p>To decrease the counter variable, you must use a negative <strong>Step</strong> value. You must specify an end value that is less than the start value.</p>
<p>In the example below, the counter variable (<strong>i</strong>) is DECREASED by two, each time the loop repeats.</p>
<div>
<div>For i=10 To 2 Step -2<br />
some code<br />
Next</div>
</div>
<h3>Exit a For&#8230;Next</h3>
<p>You can exit a For&#8230;Next statement with the Exit For keyword.</p>
<div>
<div>For i=1 To 10<br />
If i=5 Then Exit For<br />
some code<br />
Next</div>
</div>
<hr />
<h2>For Each&#8230;Next Loop</h2>
<p>A <strong>For Each&#8230;Next</strong> loop repeats a block of code for each item in a collection, or for each element of an array.</p>
<div>
<h2>Example</h2>
<div>&lt;html&gt;<br />
&lt;body&gt;</p>
<p>&lt;script type=&#8221;text/vbscript&#8221;&gt;<br />
Dim cars(2)<br />
cars(0)=&#8221;Volvo&#8221;<br />
cars(1)=&#8221;Saab&#8221;<br />
cars(2)=&#8221;BMW&#8221;</p>
<p>For Each x In cars<br />
document.write(x &amp; &#8220;&lt;br /&gt;&#8221;)<br />
Next<br />
&lt;/script&gt;</p>
<p>&lt;/body&gt;<br />
&lt;/html&gt;</p></div>
<p><a href="http://www.w3schools.com/vbscript/tryit.asp?filename=vbdemo_foreach" target="_blank">Try it yourself »</a></div>
<p>&nbsp;</p>
<hr />
<h2>Do&#8230;Loop</h2>
<p>If you don&#8217;t know how many repetitions you want, use a Do&#8230;Loop statement.</p>
<p>The Do&#8230;Loop statement repeats a block of code while a condition is true, or until a condition becomes true.</p>
<h3>Repeat Code While a Condition is True</h3>
<p>You use the While keyword to check a condition in a Do&#8230;Loop statement.</p>
<div>
<div>Do While i&gt;10<br />
some code<br />
Loop</div>
</div>
<p>If <strong>i</strong> equals 9, the code inside the loop above will never be executed.</p>
<div>
<div>Do<br />
some code<br />
Loop While i&gt;10</div>
</div>
<p>The code inside this loop will be executed at least one time, even if <strong>i</strong> is less than 10.</p>
<h3>Repeat Code Until a Condition Becomes True</h3>
<p>You use the Until keyword to check a condition in a Do&#8230;Loop statement.</p>
<div>
<div>Do Until i=10<br />
some code<br />
Loop</div>
</div>
<p>If <strong>i</strong> equals 10, the code inside the loop will never be executed.</p>
<div>
<div>Do<br />
some code<br />
Loop Until i=10</div>
</div>
<p>The code inside this loop will be executed at least one time, even if <strong>i</strong> is equal to 10.</p>
<h3>Exit a Do&#8230;Loop</h3>
<p>You can exit a Do&#8230;Loop statement with the Exit Do keyword.</p>
<div>
<div>Do Until i=10<br />
i=i-1<br />
If i&lt;10 Then Exit Do<br />
Loop</div>
</div>
<p>The code inside this loop will be executed as long as <strong>i</strong> is different from 10, and as long as <strong>i</strong> is greater than 10.</p>
<p>source from: <a href="http://www.w3schools.com/">w3schools</a></p>



Share and Enjoy:


	<a rel="nofollow"  target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-looping%2F&amp;title=VBScript%20Looping%20%20&amp;bodytext=Looping%20Statements%0D%0ALooping%20statements%20are%20used%20to%20run%20the%20same%20block%20of%20code%20a%20specified%20number%20of%20times.%0D%0A%0D%0AIn%20VBScript%20we%20have%20four%20looping%20statements%3A%0D%0A%0D%0A%09For...Next%20statement%C2%A0-%20runs%20code%20a%20specified%20number%20of%20times%0D%0A%09For%20Each...Next%20statement%C2%A0" title="Digg"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" /></a>
	<a rel="nofollow"  target="_blank" href="http://sphinn.com/index.php?c=post&amp;m=submit&amp;link=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-looping%2F" title="Sphinn"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/sphinn.png" title="Sphinn" alt="Sphinn" /></a>
	<a rel="nofollow"  target="_blank" href="http://delicious.com/post?url=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-looping%2F&amp;title=VBScript%20Looping%20%20&amp;notes=Looping%20Statements%0D%0ALooping%20statements%20are%20used%20to%20run%20the%20same%20block%20of%20code%20a%20specified%20number%20of%20times.%0D%0A%0D%0AIn%20VBScript%20we%20have%20four%20looping%20statements%3A%0D%0A%0D%0A%09For...Next%20statement%C2%A0-%20runs%20code%20a%20specified%20number%20of%20times%0D%0A%09For%20Each...Next%20statement%C2%A0" title="del.icio.us"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-looping%2F&amp;t=VBScript%20Looping%20%20" title="Facebook"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.mixx.com/submit?page_url=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-looping%2F&amp;title=VBScript%20Looping%20%20" title="Mixx"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/mixx.png" title="Mixx" alt="Mixx" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-looping%2F&amp;title=VBScript%20Looping%20%20&amp;annotation=Looping%20Statements%0D%0ALooping%20statements%20are%20used%20to%20run%20the%20same%20block%20of%20code%20a%20specified%20number%20of%20times.%0D%0A%0D%0AIn%20VBScript%20we%20have%20four%20looping%20statements%3A%0D%0A%0D%0A%09For...Next%20statement%C2%A0-%20runs%20code%20a%20specified%20number%20of%20times%0D%0A%09For%20Each...Next%20statement%C2%A0" title="Google Bookmarks"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.diigo.com/post?url=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-looping%2F&amp;title=VBScript%20Looping%20%20" title="Diigo"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/diigo.png" title="Diigo" alt="Diigo" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.dzone.com/links/add.html?url=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-looping%2F&amp;title=VBScript%20Looping%20%20" title="DZone"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/dzone.png" title="DZone" alt="DZone" /></a>
	<a rel="nofollow"  target="_blank" href="http://cgi.fark.com/cgi/fark/farkit.pl?h=VBScript%20Looping%20%20&amp;u=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-looping%2F" title="Fark"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/fark.png" title="Fark" alt="Fark" /></a>
	<a rel="nofollow"  target="_blank" href="http://faves.com/Authoring.aspx?u=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-looping%2F&amp;title=VBScript%20Looping%20%20" title="Faves"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/bluedot.png" title="Faves" alt="Faves" /></a>
	<a rel="nofollow"  target="_blank" href="http://laaik.it/NewStoryCompact.aspx?uri=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-looping%2F&amp;headline=VBScript%20Looping%20%20&amp;cat=5e082fcc-8a3b-47e2-acec-fdf64ff19d12" title="laaik.it"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/laaikit.png" title="laaik.it" alt="laaik.it" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-looping%2F&amp;title=VBScript%20Looping%20%20&amp;source=Classifieds+Scripts%2C+Web+Scripts%2C++Ajax+Scripts%2C+PHP+Scripts%2C+ASP+Scripts+AJAX%2C+PHP+Scripts%2C+ASP+Scripts%2C+Ad+Management%2C+Bookmark+Management%2C+Database+Tools%2C+Chat+Scripts%2C+HTML+Editors%2C+Classified+Ads+Scripts%2C+Classifieds+Script&amp;summary=Looping%20Statements%0D%0ALooping%20statements%20are%20used%20to%20run%20the%20same%20block%20of%20code%20a%20specified%20number%20of%20times.%0D%0A%0D%0AIn%20VBScript%20we%20have%20four%20looping%20statements%3A%0D%0A%0D%0A%09For...Next%20statement%C2%A0-%20runs%20code%20a%20specified%20number%20of%20times%0D%0A%09For%20Each...Next%20statement%C2%A0" title="LinkedIn"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" /></a>
	<a rel="nofollow"  target="_blank" href="https://favorites.live.com/quickadd.aspx?marklet=1&amp;url=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-looping%2F&amp;title=VBScript%20Looping%20%20" title="Live"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/live.png" title="Live" alt="Live" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.mister-wong.com/addurl/?bm_url=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-looping%2F&amp;bm_description=VBScript%20Looping%20%20&amp;plugin=soc" title="MisterWong"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/misterwong.png" title="MisterWong" alt="MisterWong" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.myspace.com/Modules/PostTo/Pages/?u=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-looping%2F&amp;t=VBScript%20Looping%20%20" title="MySpace"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/myspace.png" title="MySpace" alt="MySpace" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.netvibes.com/share?title=VBScript%20Looping%20%20&amp;url=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-looping%2F" title="Netvibes"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/netvibes.png" title="Netvibes" alt="Netvibes" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.netvouz.com/action/submitBookmark?url=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-looping%2F&amp;title=VBScript%20Looping%20%20&amp;popup=no" title="Netvouz"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/netvouz.png" title="Netvouz" alt="Netvouz" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.newsvine.com/_tools/seed&amp;save?u=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-looping%2F&amp;h=VBScript%20Looping%20%20" title="NewsVine"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/newsvine.png" title="NewsVine" alt="NewsVine" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.propeller.com/submit/?url=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-looping%2F" title="Propeller"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/propeller.png" title="Propeller" alt="Propeller" /></a>
	<a rel="nofollow"  target="_blank" href="http://reddit.com/submit?url=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-looping%2F&amp;title=VBScript%20Looping%20%20" title="Reddit"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" /></a>
	<a rel="nofollow"  target="_blank" href="http://slashdot.org/bookmark.pl?title=VBScript%20Looping%20%20&amp;url=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-looping%2F" title="Slashdot"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/slashdot.png" title="Slashdot" alt="Slashdot" /></a>
	<a rel="nofollow"  target="_blank" href="http://socialogs.com/add_story.php?story_url=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-looping%2F&amp;story_title=VBScript%20Looping%20%20" title="Socialogs"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/socialogs.png" title="Socialogs" alt="Socialogs" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-looping%2F&amp;title=VBScript%20Looping%20%20" title="StumbleUpon"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" /></a>
	<a rel="nofollow"  target="_blank" href="http://technorati.com/faves?add=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-looping%2F" title="Technorati"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" /></a>
	<a rel="nofollow"  target="_blank" href="http://twitter.com/home?status=VBScript%20Looping%20%20%20-%20http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-looping%2F" title="Twitter"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" /></a>
	<a rel="nofollow"  target="_blank" href="http://buzz.yahoo.com/submit/?submitUrl=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-looping%2F&amp;submitHeadline=VBScript%20Looping%20%20&amp;submitSummary=Looping%20Statements%0D%0ALooping%20statements%20are%20used%20to%20run%20the%20same%20block%20of%20code%20a%20specified%20number%20of%20times.%0D%0A%0D%0AIn%20VBScript%20we%20have%20four%20looping%20statements%3A%0D%0A%0D%0A%09For...Next%20statement%C2%A0-%20runs%20code%20a%20specified%20number%20of%20times%0D%0A%09For%20Each...Next%20statement%C2%A0&amp;submitCategory=science&amp;submitAssetType=text" title="Yahoo! Buzz"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/yahoobuzz.png" title="Yahoo! Buzz" alt="Yahoo! Buzz" /></a>


<br/><br/>]]></content:encoded>
			<wfw:commentRss>http://www.scriptclassifieds.com/vbscript/vbscript-looping/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>You Have Learned VBScript, Now What?</title>
		<link>http://www.scriptclassifieds.com/vbscript/you-have-learned-vbscript-now-what/</link>
		<comments>http://www.scriptclassifieds.com/vbscript/you-have-learned-vbscript-now-what/#comments</comments>
		<pubDate>Tue, 08 May 2012 08:21:28 +0000</pubDate>
		<dc:creator>thanhlangtu</dc:creator>
				<category><![CDATA[VBScript]]></category>
		<category><![CDATA[Learned]]></category>
		<category><![CDATA[Summary]]></category>

		<guid isPermaLink="false">http://www.scriptclassifieds.com/?p=1204</guid>
		<description><![CDATA[VBScript Summary This tutorial has taught you how to add VBScript to your HTML pages, to make your web site more dynamic and interactive. You have learned how to create variables and functions, and how to make different scripts run in response to different scenarios. For more information on VBScript, please look at our VBScript examples and [...]]]></description>
			<content:encoded><![CDATA[<h2>VBScript Summary</h2>
<p>This tutorial has taught you how to add VBScript to your HTML pages, to make your web site more dynamic and interactive.</p>
<p>You have learned how to create variables and functions, and how to make different scripts run in response to different scenarios.</p>
<p>For more information on VBScript, please look at our VBScript examples and our VBScript references.</p>
<hr />
<h2>Now You Know VBScript, What&#8217;s Next?</h2>
<p>The next step is to learn ASP.</p>
<p>While scripts in an HTML file are executed on the client (in the browser), scripts in an ASP file are executed on the server.</p>
<p>With ASP you can dynamically edit, change or add any content of a Web page, respond to data submitted from HTML forms, access any data or databases and return the results to a browser, customize a Web page to make it more useful for individual users.</p>
<p>Since ASP files are returned as plain HTML, they can be viewed in any browser.</p>
<p>If you want to learn more about ASP, please visit our ASP tutorial.</p>
<p>source from: <a href="http://www.w3schools.com/">w3schools</a></p>



Share and Enjoy:


	<a rel="nofollow"  target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fyou-have-learned-vbscript-now-what%2F&amp;title=You%20Have%20Learned%20VBScript%2C%20Now%20What%3F%20%20&amp;bodytext=VBScript%20Summary%0D%0AThis%20tutorial%20has%20taught%20you%20how%20to%20add%20VBScript%20to%20your%20HTML%20pages%2C%20to%20make%20your%20web%20site%20more%20dynamic%20and%20interactive.%0D%0A%0D%0AYou%20have%20learned%20how%20to%20create%20variables%20and%20functions%2C%20and%20how%20to%20make%20different%20scripts%20run%20in%20response%20to" title="Digg"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" /></a>
	<a rel="nofollow"  target="_blank" href="http://sphinn.com/index.php?c=post&amp;m=submit&amp;link=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fyou-have-learned-vbscript-now-what%2F" title="Sphinn"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/sphinn.png" title="Sphinn" alt="Sphinn" /></a>
	<a rel="nofollow"  target="_blank" href="http://delicious.com/post?url=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fyou-have-learned-vbscript-now-what%2F&amp;title=You%20Have%20Learned%20VBScript%2C%20Now%20What%3F%20%20&amp;notes=VBScript%20Summary%0D%0AThis%20tutorial%20has%20taught%20you%20how%20to%20add%20VBScript%20to%20your%20HTML%20pages%2C%20to%20make%20your%20web%20site%20more%20dynamic%20and%20interactive.%0D%0A%0D%0AYou%20have%20learned%20how%20to%20create%20variables%20and%20functions%2C%20and%20how%20to%20make%20different%20scripts%20run%20in%20response%20to" title="del.icio.us"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fyou-have-learned-vbscript-now-what%2F&amp;t=You%20Have%20Learned%20VBScript%2C%20Now%20What%3F%20%20" title="Facebook"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.mixx.com/submit?page_url=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fyou-have-learned-vbscript-now-what%2F&amp;title=You%20Have%20Learned%20VBScript%2C%20Now%20What%3F%20%20" title="Mixx"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/mixx.png" title="Mixx" alt="Mixx" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fyou-have-learned-vbscript-now-what%2F&amp;title=You%20Have%20Learned%20VBScript%2C%20Now%20What%3F%20%20&amp;annotation=VBScript%20Summary%0D%0AThis%20tutorial%20has%20taught%20you%20how%20to%20add%20VBScript%20to%20your%20HTML%20pages%2C%20to%20make%20your%20web%20site%20more%20dynamic%20and%20interactive.%0D%0A%0D%0AYou%20have%20learned%20how%20to%20create%20variables%20and%20functions%2C%20and%20how%20to%20make%20different%20scripts%20run%20in%20response%20to" title="Google Bookmarks"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.diigo.com/post?url=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fyou-have-learned-vbscript-now-what%2F&amp;title=You%20Have%20Learned%20VBScript%2C%20Now%20What%3F%20%20" title="Diigo"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/diigo.png" title="Diigo" alt="Diigo" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.dzone.com/links/add.html?url=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fyou-have-learned-vbscript-now-what%2F&amp;title=You%20Have%20Learned%20VBScript%2C%20Now%20What%3F%20%20" title="DZone"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/dzone.png" title="DZone" alt="DZone" /></a>
	<a rel="nofollow"  target="_blank" href="http://cgi.fark.com/cgi/fark/farkit.pl?h=You%20Have%20Learned%20VBScript%2C%20Now%20What%3F%20%20&amp;u=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fyou-have-learned-vbscript-now-what%2F" title="Fark"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/fark.png" title="Fark" alt="Fark" /></a>
	<a rel="nofollow"  target="_blank" href="http://faves.com/Authoring.aspx?u=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fyou-have-learned-vbscript-now-what%2F&amp;title=You%20Have%20Learned%20VBScript%2C%20Now%20What%3F%20%20" title="Faves"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/bluedot.png" title="Faves" alt="Faves" /></a>
	<a rel="nofollow"  target="_blank" href="http://laaik.it/NewStoryCompact.aspx?uri=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fyou-have-learned-vbscript-now-what%2F&amp;headline=You%20Have%20Learned%20VBScript%2C%20Now%20What%3F%20%20&amp;cat=5e082fcc-8a3b-47e2-acec-fdf64ff19d12" title="laaik.it"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/laaikit.png" title="laaik.it" alt="laaik.it" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fyou-have-learned-vbscript-now-what%2F&amp;title=You%20Have%20Learned%20VBScript%2C%20Now%20What%3F%20%20&amp;source=Classifieds+Scripts%2C+Web+Scripts%2C++Ajax+Scripts%2C+PHP+Scripts%2C+ASP+Scripts+AJAX%2C+PHP+Scripts%2C+ASP+Scripts%2C+Ad+Management%2C+Bookmark+Management%2C+Database+Tools%2C+Chat+Scripts%2C+HTML+Editors%2C+Classified+Ads+Scripts%2C+Classifieds+Script&amp;summary=VBScript%20Summary%0D%0AThis%20tutorial%20has%20taught%20you%20how%20to%20add%20VBScript%20to%20your%20HTML%20pages%2C%20to%20make%20your%20web%20site%20more%20dynamic%20and%20interactive.%0D%0A%0D%0AYou%20have%20learned%20how%20to%20create%20variables%20and%20functions%2C%20and%20how%20to%20make%20different%20scripts%20run%20in%20response%20to" title="LinkedIn"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" /></a>
	<a rel="nofollow"  target="_blank" href="https://favorites.live.com/quickadd.aspx?marklet=1&amp;url=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fyou-have-learned-vbscript-now-what%2F&amp;title=You%20Have%20Learned%20VBScript%2C%20Now%20What%3F%20%20" title="Live"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/live.png" title="Live" alt="Live" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.mister-wong.com/addurl/?bm_url=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fyou-have-learned-vbscript-now-what%2F&amp;bm_description=You%20Have%20Learned%20VBScript%2C%20Now%20What%3F%20%20&amp;plugin=soc" title="MisterWong"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/misterwong.png" title="MisterWong" alt="MisterWong" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.myspace.com/Modules/PostTo/Pages/?u=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fyou-have-learned-vbscript-now-what%2F&amp;t=You%20Have%20Learned%20VBScript%2C%20Now%20What%3F%20%20" title="MySpace"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/myspace.png" title="MySpace" alt="MySpace" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.netvibes.com/share?title=You%20Have%20Learned%20VBScript%2C%20Now%20What%3F%20%20&amp;url=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fyou-have-learned-vbscript-now-what%2F" title="Netvibes"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/netvibes.png" title="Netvibes" alt="Netvibes" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.netvouz.com/action/submitBookmark?url=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fyou-have-learned-vbscript-now-what%2F&amp;title=You%20Have%20Learned%20VBScript%2C%20Now%20What%3F%20%20&amp;popup=no" title="Netvouz"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/netvouz.png" title="Netvouz" alt="Netvouz" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.newsvine.com/_tools/seed&amp;save?u=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fyou-have-learned-vbscript-now-what%2F&amp;h=You%20Have%20Learned%20VBScript%2C%20Now%20What%3F%20%20" title="NewsVine"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/newsvine.png" title="NewsVine" alt="NewsVine" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.propeller.com/submit/?url=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fyou-have-learned-vbscript-now-what%2F" title="Propeller"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/propeller.png" title="Propeller" alt="Propeller" /></a>
	<a rel="nofollow"  target="_blank" href="http://reddit.com/submit?url=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fyou-have-learned-vbscript-now-what%2F&amp;title=You%20Have%20Learned%20VBScript%2C%20Now%20What%3F%20%20" title="Reddit"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" /></a>
	<a rel="nofollow"  target="_blank" href="http://slashdot.org/bookmark.pl?title=You%20Have%20Learned%20VBScript%2C%20Now%20What%3F%20%20&amp;url=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fyou-have-learned-vbscript-now-what%2F" title="Slashdot"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/slashdot.png" title="Slashdot" alt="Slashdot" /></a>
	<a rel="nofollow"  target="_blank" href="http://socialogs.com/add_story.php?story_url=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fyou-have-learned-vbscript-now-what%2F&amp;story_title=You%20Have%20Learned%20VBScript%2C%20Now%20What%3F%20%20" title="Socialogs"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/socialogs.png" title="Socialogs" alt="Socialogs" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fyou-have-learned-vbscript-now-what%2F&amp;title=You%20Have%20Learned%20VBScript%2C%20Now%20What%3F%20%20" title="StumbleUpon"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" /></a>
	<a rel="nofollow"  target="_blank" href="http://technorati.com/faves?add=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fyou-have-learned-vbscript-now-what%2F" title="Technorati"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" /></a>
	<a rel="nofollow"  target="_blank" href="http://twitter.com/home?status=You%20Have%20Learned%20VBScript%2C%20Now%20What%3F%20%20%20-%20http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fyou-have-learned-vbscript-now-what%2F" title="Twitter"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" /></a>
	<a rel="nofollow"  target="_blank" href="http://buzz.yahoo.com/submit/?submitUrl=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fyou-have-learned-vbscript-now-what%2F&amp;submitHeadline=You%20Have%20Learned%20VBScript%2C%20Now%20What%3F%20%20&amp;submitSummary=VBScript%20Summary%0D%0AThis%20tutorial%20has%20taught%20you%20how%20to%20add%20VBScript%20to%20your%20HTML%20pages%2C%20to%20make%20your%20web%20site%20more%20dynamic%20and%20interactive.%0D%0A%0D%0AYou%20have%20learned%20how%20to%20create%20variables%20and%20functions%2C%20and%20how%20to%20make%20different%20scripts%20run%20in%20response%20to&amp;submitCategory=science&amp;submitAssetType=text" title="Yahoo! Buzz"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/yahoobuzz.png" title="Yahoo! Buzz" alt="Yahoo! Buzz" /></a>


<br/><br/>]]></content:encoded>
			<wfw:commentRss>http://www.scriptclassifieds.com/vbscript/you-have-learned-vbscript-now-what/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>VBScript Introduction</title>
		<link>http://www.scriptclassifieds.com/vbscript/vbscript-introduction/</link>
		<comments>http://www.scriptclassifieds.com/vbscript/vbscript-introduction/#comments</comments>
		<pubDate>Fri, 20 Apr 2012 10:25:44 +0000</pubDate>
		<dc:creator>thanhlangtu</dc:creator>
				<category><![CDATA[VBScript]]></category>
		<category><![CDATA[Introduction]]></category>

		<guid isPermaLink="false">http://www.scriptclassifieds.com/?p=1197</guid>
		<description><![CDATA[What You Should Already Know Before you continue you should have a basic understanding of the following: HTML / XHTML If you want to study these subjects first, find the tutorials on our Home page. What is VBScript? VBScript is a scripting language A scripting language is a lightweight programming language VBScript is a light version [...]]]></description>
			<content:encoded><![CDATA[<h2>What You Should Already Know</h2>
<p>Before you continue you should have a basic understanding of the following:</p>
<ul>
<li>HTML / XHTML</li>
</ul>
<p>If you want to study these subjects first, find the tutorials on our Home page.</p>
<hr />
<h2>What is VBScript?</h2>
<ul>
<li>VBScript is a scripting language</li>
<li>A scripting language is a lightweight programming language</li>
<li>VBScript is a light version of Microsoft&#8217;s programming language Visual Basic</li>
<li><strong>VBScript is only supported by Microsoft&#8217;s browsers (Internet Explorer)</strong></li>
</ul>
<hr />
<h2>How Does it Work?</h2>
<p>When a VBScript is inserted into an HTML document, Internet Explorer browser will read the HTML and interpret the VBScript. The VBScript can be executed immediately, or at a later event.</p>
<p>VBScript only works in Microsoft browsers (Internet Explorer).</p>
<p>source from: <a href="http://www.w3schools.com/">w3schools</a></p>



Share and Enjoy:


	<a rel="nofollow"  target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-introduction%2F&amp;title=VBScript%20Introduction&amp;bodytext=What%20You%20Should%20Already%20Know%0D%0ABefore%20you%20continue%20you%20should%20have%20a%20basic%20understanding%20of%20the%20following%3A%0D%0A%0D%0A%09HTML%20%2F%20XHTML%0D%0A%0D%0AIf%20you%20want%20to%20study%20these%20subjects%20first%2C%20find%20the%20tutorials%20on%20our%C2%A0Home%20page.%0D%0A%0D%0A%0D%0A%0D%0AWhat%20is%20VBScript%3F%0D%0A%0D%0A%09VBScript%20is%20a%20" title="Digg"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" /></a>
	<a rel="nofollow"  target="_blank" href="http://sphinn.com/index.php?c=post&amp;m=submit&amp;link=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-introduction%2F" title="Sphinn"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/sphinn.png" title="Sphinn" alt="Sphinn" /></a>
	<a rel="nofollow"  target="_blank" href="http://delicious.com/post?url=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-introduction%2F&amp;title=VBScript%20Introduction&amp;notes=What%20You%20Should%20Already%20Know%0D%0ABefore%20you%20continue%20you%20should%20have%20a%20basic%20understanding%20of%20the%20following%3A%0D%0A%0D%0A%09HTML%20%2F%20XHTML%0D%0A%0D%0AIf%20you%20want%20to%20study%20these%20subjects%20first%2C%20find%20the%20tutorials%20on%20our%C2%A0Home%20page.%0D%0A%0D%0A%0D%0A%0D%0AWhat%20is%20VBScript%3F%0D%0A%0D%0A%09VBScript%20is%20a%20" title="del.icio.us"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-introduction%2F&amp;t=VBScript%20Introduction" title="Facebook"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.mixx.com/submit?page_url=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-introduction%2F&amp;title=VBScript%20Introduction" title="Mixx"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/mixx.png" title="Mixx" alt="Mixx" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-introduction%2F&amp;title=VBScript%20Introduction&amp;annotation=What%20You%20Should%20Already%20Know%0D%0ABefore%20you%20continue%20you%20should%20have%20a%20basic%20understanding%20of%20the%20following%3A%0D%0A%0D%0A%09HTML%20%2F%20XHTML%0D%0A%0D%0AIf%20you%20want%20to%20study%20these%20subjects%20first%2C%20find%20the%20tutorials%20on%20our%C2%A0Home%20page.%0D%0A%0D%0A%0D%0A%0D%0AWhat%20is%20VBScript%3F%0D%0A%0D%0A%09VBScript%20is%20a%20" title="Google Bookmarks"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.diigo.com/post?url=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-introduction%2F&amp;title=VBScript%20Introduction" title="Diigo"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/diigo.png" title="Diigo" alt="Diigo" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.dzone.com/links/add.html?url=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-introduction%2F&amp;title=VBScript%20Introduction" title="DZone"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/dzone.png" title="DZone" alt="DZone" /></a>
	<a rel="nofollow"  target="_blank" href="http://cgi.fark.com/cgi/fark/farkit.pl?h=VBScript%20Introduction&amp;u=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-introduction%2F" title="Fark"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/fark.png" title="Fark" alt="Fark" /></a>
	<a rel="nofollow"  target="_blank" href="http://faves.com/Authoring.aspx?u=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-introduction%2F&amp;title=VBScript%20Introduction" title="Faves"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/bluedot.png" title="Faves" alt="Faves" /></a>
	<a rel="nofollow"  target="_blank" href="http://laaik.it/NewStoryCompact.aspx?uri=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-introduction%2F&amp;headline=VBScript%20Introduction&amp;cat=5e082fcc-8a3b-47e2-acec-fdf64ff19d12" title="laaik.it"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/laaikit.png" title="laaik.it" alt="laaik.it" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-introduction%2F&amp;title=VBScript%20Introduction&amp;source=Classifieds+Scripts%2C+Web+Scripts%2C++Ajax+Scripts%2C+PHP+Scripts%2C+ASP+Scripts+AJAX%2C+PHP+Scripts%2C+ASP+Scripts%2C+Ad+Management%2C+Bookmark+Management%2C+Database+Tools%2C+Chat+Scripts%2C+HTML+Editors%2C+Classified+Ads+Scripts%2C+Classifieds+Script&amp;summary=What%20You%20Should%20Already%20Know%0D%0ABefore%20you%20continue%20you%20should%20have%20a%20basic%20understanding%20of%20the%20following%3A%0D%0A%0D%0A%09HTML%20%2F%20XHTML%0D%0A%0D%0AIf%20you%20want%20to%20study%20these%20subjects%20first%2C%20find%20the%20tutorials%20on%20our%C2%A0Home%20page.%0D%0A%0D%0A%0D%0A%0D%0AWhat%20is%20VBScript%3F%0D%0A%0D%0A%09VBScript%20is%20a%20" title="LinkedIn"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" /></a>
	<a rel="nofollow"  target="_blank" href="https://favorites.live.com/quickadd.aspx?marklet=1&amp;url=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-introduction%2F&amp;title=VBScript%20Introduction" title="Live"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/live.png" title="Live" alt="Live" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.mister-wong.com/addurl/?bm_url=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-introduction%2F&amp;bm_description=VBScript%20Introduction&amp;plugin=soc" title="MisterWong"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/misterwong.png" title="MisterWong" alt="MisterWong" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.myspace.com/Modules/PostTo/Pages/?u=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-introduction%2F&amp;t=VBScript%20Introduction" title="MySpace"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/myspace.png" title="MySpace" alt="MySpace" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.netvibes.com/share?title=VBScript%20Introduction&amp;url=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-introduction%2F" title="Netvibes"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/netvibes.png" title="Netvibes" alt="Netvibes" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.netvouz.com/action/submitBookmark?url=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-introduction%2F&amp;title=VBScript%20Introduction&amp;popup=no" title="Netvouz"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/netvouz.png" title="Netvouz" alt="Netvouz" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.newsvine.com/_tools/seed&amp;save?u=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-introduction%2F&amp;h=VBScript%20Introduction" title="NewsVine"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/newsvine.png" title="NewsVine" alt="NewsVine" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.propeller.com/submit/?url=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-introduction%2F" title="Propeller"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/propeller.png" title="Propeller" alt="Propeller" /></a>
	<a rel="nofollow"  target="_blank" href="http://reddit.com/submit?url=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-introduction%2F&amp;title=VBScript%20Introduction" title="Reddit"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" /></a>
	<a rel="nofollow"  target="_blank" href="http://slashdot.org/bookmark.pl?title=VBScript%20Introduction&amp;url=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-introduction%2F" title="Slashdot"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/slashdot.png" title="Slashdot" alt="Slashdot" /></a>
	<a rel="nofollow"  target="_blank" href="http://socialogs.com/add_story.php?story_url=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-introduction%2F&amp;story_title=VBScript%20Introduction" title="Socialogs"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/socialogs.png" title="Socialogs" alt="Socialogs" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-introduction%2F&amp;title=VBScript%20Introduction" title="StumbleUpon"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" /></a>
	<a rel="nofollow"  target="_blank" href="http://technorati.com/faves?add=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-introduction%2F" title="Technorati"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" /></a>
	<a rel="nofollow"  target="_blank" href="http://twitter.com/home?status=VBScript%20Introduction%20-%20http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-introduction%2F" title="Twitter"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" /></a>
	<a rel="nofollow"  target="_blank" href="http://buzz.yahoo.com/submit/?submitUrl=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-introduction%2F&amp;submitHeadline=VBScript%20Introduction&amp;submitSummary=What%20You%20Should%20Already%20Know%0D%0ABefore%20you%20continue%20you%20should%20have%20a%20basic%20understanding%20of%20the%20following%3A%0D%0A%0D%0A%09HTML%20%2F%20XHTML%0D%0A%0D%0AIf%20you%20want%20to%20study%20these%20subjects%20first%2C%20find%20the%20tutorials%20on%20our%C2%A0Home%20page.%0D%0A%0D%0A%0D%0A%0D%0AWhat%20is%20VBScript%3F%0D%0A%0D%0A%09VBScript%20is%20a%20&amp;submitCategory=science&amp;submitAssetType=text" title="Yahoo! Buzz"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/yahoobuzz.png" title="Yahoo! Buzz" alt="Yahoo! Buzz" /></a>


<br/><br/>]]></content:encoded>
			<wfw:commentRss>http://www.scriptclassifieds.com/vbscript/vbscript-introduction/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>VBScript How To</title>
		<link>http://www.scriptclassifieds.com/vbscript/vbscript-how-to/</link>
		<comments>http://www.scriptclassifieds.com/vbscript/vbscript-how-to/#comments</comments>
		<pubDate>Fri, 20 Apr 2012 10:25:39 +0000</pubDate>
		<dc:creator>thanhlangtu</dc:creator>
				<category><![CDATA[VBScript]]></category>
		<category><![CDATA[How To]]></category>

		<guid isPermaLink="false">http://www.scriptclassifieds.com/?p=1194</guid>
		<description><![CDATA[The HTML &#60;script&#62; tag is used to insert a VBScript into an HTML page. Put a VBScript into an HTML Page The example below shows how to use VBScript to write text on a web page: Example (IE Only) &#60;html&#62; &#60;body&#62; &#60;script type=&#8221;text/vbscript&#8221;&#62; document.write(&#8220;Hello World!&#8221;) &#60;/script&#62; &#60;/body&#62; &#60;/html&#62; Try it yourself » The example below [...]]]></description>
			<content:encoded><![CDATA[<p>The HTML &lt;script&gt; tag is used to insert a VBScript into an HTML page.</p>
<hr />
<h2>Put a VBScript into an HTML Page</h2>
<p>The example below shows how to use VBScript to write text on a web page:</p>
<div>
<h2>Example (IE Only)</h2>
<div>&lt;html&gt;<br />
&lt;body&gt;<br />
&lt;script type=&#8221;text/vbscript&#8221;&gt;<br />
document.write(&#8220;Hello World!&#8221;)<br />
&lt;/script&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;</div>
<p><a href="http://www.w3schools.com/vbscript/tryit.asp?filename=vbdemo_text" target="_blank">Try it yourself »</a></div>
<p>The example below shows how to add HTML tags to the VBScript:</p>
<div>
<h2>Example (IE Only)</h2>
<div>&lt;html&gt;<br />
&lt;body&gt;<br />
&lt;script type=&#8221;text/vbscript&#8221;&gt;<br />
document.write(&#8220;&lt;h1&gt;Hello World!&lt;/h1&gt;&#8221;)<br />
&lt;/script&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;</div>
<p><a href="http://www.w3schools.com/vbscript/tryit.asp?filename=vbdemo_formattext" target="_blank">Try it yourself »</a></div>
<p>&nbsp;</p>
<hr />
<h2>Example Explained</h2>
<p>To insert a VBScript into an HTML page, we use the &lt;script&gt; tag. Inside the &lt;script&gt; tag we use the type attribute to define the scripting language.</p>
<p>So, the &lt;script type=&#8221;text/vbscript&#8221;&gt; and &lt;/script&gt; tells where the VBScript starts and ends:</p>
<div>
<div>&lt;html&gt;<br />
&lt;body&gt;<br />
&lt;script type=&#8221;text/vbscript&#8221;&gt;<br />
&#8230;<br />
&lt;/script&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;</div>
</div>
<p>The <strong>document.write</strong> command is a standard VBScript command for writing output to a page.</p>
<p>By entering the document.write command between the &lt;script&gt; and &lt;/script&gt; tags, the browser will recognize it as a VBScript command and execute the code line. In this case the browser will write Hello World! to the page:</p>
<div>
<div>&lt;html&gt;<br />
&lt;body&gt;<br />
&lt;script type=&#8221;text/vbscript&#8221;&gt;<br />
document.write(&#8220;Hello World!&#8221;)<br />
&lt;/script&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;</div>
</div>
<p>&nbsp;</p>
<hr />
<h2>How to Handle Simple Browsers</h2>
<p>Browsers that do not support scripting, will display VBScript as page content.</p>
<p>To prevent them from doing this, the HTML comment tag should be used to &#8220;hide&#8221; the VBScript.</p>
<p>Just add an HTML comment tag &lt;!&#8211; before the first VBScript statement, and a &#8211;&gt; (end of comment) after the last VBScript statement, like this:</p>
<div>
<div>&lt;html&gt;<br />
&lt;body&gt;<br />
&lt;script type=&#8221;text/vbscript&#8221;&gt;<br />
&lt;!&#8211;<br />
document.write(&#8220;Hello World!&#8221;)<br />
&#8211;&gt;<br />
&lt;/script&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;</div>
</div>
<p>source from: <a href="http://www.w3schools.com/">w3schools</a></p>



Share and Enjoy:


	<a rel="nofollow"  target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-how-to%2F&amp;title=VBScript%20How%20To&amp;bodytext=The%20HTML%20%26lt%3Bscript%26gt%3B%20tag%20is%20used%20to%20insert%20a%20VBScript%20into%20an%20HTML%20page.%0D%0A%0D%0A%0D%0A%0D%0APut%20a%20VBScript%20into%20an%20HTML%20Page%0D%0AThe%20example%20below%20shows%20how%20to%20use%20VBScript%20to%20write%20text%20on%20a%20web%20page%3A%0D%0A%0D%0AExample%20%28IE%20Only%29%0D%0A%26lt%3Bhtml%26gt%3B%0D%0A%26lt%3Bbody%26gt%3B%0D%0A%26lt%3Bscript" title="Digg"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" /></a>
	<a rel="nofollow"  target="_blank" href="http://sphinn.com/index.php?c=post&amp;m=submit&amp;link=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-how-to%2F" title="Sphinn"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/sphinn.png" title="Sphinn" alt="Sphinn" /></a>
	<a rel="nofollow"  target="_blank" href="http://delicious.com/post?url=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-how-to%2F&amp;title=VBScript%20How%20To&amp;notes=The%20HTML%20%26lt%3Bscript%26gt%3B%20tag%20is%20used%20to%20insert%20a%20VBScript%20into%20an%20HTML%20page.%0D%0A%0D%0A%0D%0A%0D%0APut%20a%20VBScript%20into%20an%20HTML%20Page%0D%0AThe%20example%20below%20shows%20how%20to%20use%20VBScript%20to%20write%20text%20on%20a%20web%20page%3A%0D%0A%0D%0AExample%20%28IE%20Only%29%0D%0A%26lt%3Bhtml%26gt%3B%0D%0A%26lt%3Bbody%26gt%3B%0D%0A%26lt%3Bscript" title="del.icio.us"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-how-to%2F&amp;t=VBScript%20How%20To" title="Facebook"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.mixx.com/submit?page_url=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-how-to%2F&amp;title=VBScript%20How%20To" title="Mixx"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/mixx.png" title="Mixx" alt="Mixx" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-how-to%2F&amp;title=VBScript%20How%20To&amp;annotation=The%20HTML%20%26lt%3Bscript%26gt%3B%20tag%20is%20used%20to%20insert%20a%20VBScript%20into%20an%20HTML%20page.%0D%0A%0D%0A%0D%0A%0D%0APut%20a%20VBScript%20into%20an%20HTML%20Page%0D%0AThe%20example%20below%20shows%20how%20to%20use%20VBScript%20to%20write%20text%20on%20a%20web%20page%3A%0D%0A%0D%0AExample%20%28IE%20Only%29%0D%0A%26lt%3Bhtml%26gt%3B%0D%0A%26lt%3Bbody%26gt%3B%0D%0A%26lt%3Bscript" title="Google Bookmarks"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.diigo.com/post?url=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-how-to%2F&amp;title=VBScript%20How%20To" title="Diigo"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/diigo.png" title="Diigo" alt="Diigo" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.dzone.com/links/add.html?url=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-how-to%2F&amp;title=VBScript%20How%20To" title="DZone"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/dzone.png" title="DZone" alt="DZone" /></a>
	<a rel="nofollow"  target="_blank" href="http://cgi.fark.com/cgi/fark/farkit.pl?h=VBScript%20How%20To&amp;u=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-how-to%2F" title="Fark"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/fark.png" title="Fark" alt="Fark" /></a>
	<a rel="nofollow"  target="_blank" href="http://faves.com/Authoring.aspx?u=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-how-to%2F&amp;title=VBScript%20How%20To" title="Faves"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/bluedot.png" title="Faves" alt="Faves" /></a>
	<a rel="nofollow"  target="_blank" href="http://laaik.it/NewStoryCompact.aspx?uri=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-how-to%2F&amp;headline=VBScript%20How%20To&amp;cat=5e082fcc-8a3b-47e2-acec-fdf64ff19d12" title="laaik.it"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/laaikit.png" title="laaik.it" alt="laaik.it" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-how-to%2F&amp;title=VBScript%20How%20To&amp;source=Classifieds+Scripts%2C+Web+Scripts%2C++Ajax+Scripts%2C+PHP+Scripts%2C+ASP+Scripts+AJAX%2C+PHP+Scripts%2C+ASP+Scripts%2C+Ad+Management%2C+Bookmark+Management%2C+Database+Tools%2C+Chat+Scripts%2C+HTML+Editors%2C+Classified+Ads+Scripts%2C+Classifieds+Script&amp;summary=The%20HTML%20%26lt%3Bscript%26gt%3B%20tag%20is%20used%20to%20insert%20a%20VBScript%20into%20an%20HTML%20page.%0D%0A%0D%0A%0D%0A%0D%0APut%20a%20VBScript%20into%20an%20HTML%20Page%0D%0AThe%20example%20below%20shows%20how%20to%20use%20VBScript%20to%20write%20text%20on%20a%20web%20page%3A%0D%0A%0D%0AExample%20%28IE%20Only%29%0D%0A%26lt%3Bhtml%26gt%3B%0D%0A%26lt%3Bbody%26gt%3B%0D%0A%26lt%3Bscript" title="LinkedIn"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" /></a>
	<a rel="nofollow"  target="_blank" href="https://favorites.live.com/quickadd.aspx?marklet=1&amp;url=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-how-to%2F&amp;title=VBScript%20How%20To" title="Live"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/live.png" title="Live" alt="Live" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.mister-wong.com/addurl/?bm_url=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-how-to%2F&amp;bm_description=VBScript%20How%20To&amp;plugin=soc" title="MisterWong"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/misterwong.png" title="MisterWong" alt="MisterWong" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.myspace.com/Modules/PostTo/Pages/?u=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-how-to%2F&amp;t=VBScript%20How%20To" title="MySpace"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/myspace.png" title="MySpace" alt="MySpace" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.netvibes.com/share?title=VBScript%20How%20To&amp;url=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-how-to%2F" title="Netvibes"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/netvibes.png" title="Netvibes" alt="Netvibes" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.netvouz.com/action/submitBookmark?url=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-how-to%2F&amp;title=VBScript%20How%20To&amp;popup=no" title="Netvouz"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/netvouz.png" title="Netvouz" alt="Netvouz" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.newsvine.com/_tools/seed&amp;save?u=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-how-to%2F&amp;h=VBScript%20How%20To" title="NewsVine"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/newsvine.png" title="NewsVine" alt="NewsVine" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.propeller.com/submit/?url=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-how-to%2F" title="Propeller"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/propeller.png" title="Propeller" alt="Propeller" /></a>
	<a rel="nofollow"  target="_blank" href="http://reddit.com/submit?url=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-how-to%2F&amp;title=VBScript%20How%20To" title="Reddit"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" /></a>
	<a rel="nofollow"  target="_blank" href="http://slashdot.org/bookmark.pl?title=VBScript%20How%20To&amp;url=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-how-to%2F" title="Slashdot"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/slashdot.png" title="Slashdot" alt="Slashdot" /></a>
	<a rel="nofollow"  target="_blank" href="http://socialogs.com/add_story.php?story_url=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-how-to%2F&amp;story_title=VBScript%20How%20To" title="Socialogs"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/socialogs.png" title="Socialogs" alt="Socialogs" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-how-to%2F&amp;title=VBScript%20How%20To" title="StumbleUpon"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" /></a>
	<a rel="nofollow"  target="_blank" href="http://technorati.com/faves?add=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-how-to%2F" title="Technorati"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" /></a>
	<a rel="nofollow"  target="_blank" href="http://twitter.com/home?status=VBScript%20How%20To%20-%20http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-how-to%2F" title="Twitter"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" /></a>
	<a rel="nofollow"  target="_blank" href="http://buzz.yahoo.com/submit/?submitUrl=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-how-to%2F&amp;submitHeadline=VBScript%20How%20To&amp;submitSummary=The%20HTML%20%26lt%3Bscript%26gt%3B%20tag%20is%20used%20to%20insert%20a%20VBScript%20into%20an%20HTML%20page.%0D%0A%0D%0A%0D%0A%0D%0APut%20a%20VBScript%20into%20an%20HTML%20Page%0D%0AThe%20example%20below%20shows%20how%20to%20use%20VBScript%20to%20write%20text%20on%20a%20web%20page%3A%0D%0A%0D%0AExample%20%28IE%20Only%29%0D%0A%26lt%3Bhtml%26gt%3B%0D%0A%26lt%3Bbody%26gt%3B%0D%0A%26lt%3Bscript&amp;submitCategory=science&amp;submitAssetType=text" title="Yahoo! Buzz"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/yahoobuzz.png" title="Yahoo! Buzz" alt="Yahoo! Buzz" /></a>


<br/><br/>]]></content:encoded>
			<wfw:commentRss>http://www.scriptclassifieds.com/vbscript/vbscript-how-to/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>VBScript Where To &#8230;</title>
		<link>http://www.scriptclassifieds.com/vbscript/vbscript-where-to/</link>
		<comments>http://www.scriptclassifieds.com/vbscript/vbscript-where-to/#comments</comments>
		<pubDate>Fri, 20 Apr 2012 10:25:37 +0000</pubDate>
		<dc:creator>thanhlangtu</dc:creator>
				<category><![CDATA[VBScript]]></category>
		<category><![CDATA[Where To]]></category>

		<guid isPermaLink="false">http://www.scriptclassifieds.com/?p=1195</guid>
		<description><![CDATA[VBScripts can be placed in the body and in the head section of an HTML document. Where to Put the VBScript VBScripts in a page will be executed immediately while the page loads into the browser. This is not always what we want. Sometimes we want to execute a script when a page loads, or [...]]]></description>
			<content:encoded><![CDATA[<p>VBScripts can be placed in the body and in the head section of an HTML document.</p>
<hr />
<h2>Where to Put the VBScript</h2>
<p>VBScripts in a page will be executed immediately while the page loads into the browser. This is not always what we want. Sometimes we want to execute a script when a page loads, or at a later event, such as when a user clicks a button. When this is the case we put the script inside a function or a sub procedure, you will learn about procedures in a later chapter.</p>
<h2>Scripts in &lt;head&gt;</h2>
<p>Put your functions and sub procedures in the head section, this way they are all in one place, and they do not interfere with page content.</p>
<div>
<h2>Example (IE Only)</h2>
<div>&lt;html&gt;<br />
&lt;head&gt;<br />
&lt;script type=&#8221;text/vbscript&#8221;&gt;<br />
function myFunction()<br />
alert(&#8220;Hello World!&#8221;)<br />
end function<br />
&lt;/script&gt;<br />
&lt;/head&gt;</p>
<p>&lt;body onload=&#8221;myFunction()&#8221;&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;</p></div>
<p><a href="http://www.w3schools.com/vbscript/tryit.asp?filename=vbdemo_headsection" target="_blank">Try it yourself »</a></div>
<h2>Scripts in &lt;body&gt;</h2>
<p>If you don&#8217;t want your script to be placed inside a function, and especially if your script should write page content, it should be placed in the body section.</p>
<div>
<h2>Example (IE Only)</h2>
<div>&lt;html&gt;<br />
&lt;head&gt;<br />
&lt;/head&gt;</p>
<p>&lt;body&gt;<br />
&lt;script type=&#8221;text/vbscript&#8221;&gt;<br />
document.write(&#8220;This message is written by VBScript&#8221;)<br />
&lt;/script&gt;<br />
&lt;/body&gt;</p>
<p>&lt;/html&gt;</p></div>
<p><a href="http://www.w3schools.com/vbscript/tryit.asp?filename=vbdemo_bodysection" target="_blank">Try it yourself »</a></div>
<h2>Scripts in &lt;head&gt; and &lt;body&gt;</h2>
<p>You can place an unlimited number of scripts in your document, and you can have scripts in both the body and the head section.</p>
<div>
<h2>Example (IE Only)</h2>
<div>&lt;html&gt;<br />
&lt;head&gt;<br />
&lt;script type=&#8221;text/vbscript&#8221;&gt;<br />
function myFunction()<br />
alert(&#8220;Hello World!&#8221;)<br />
end function<br />
&lt;/script&gt;<br />
&lt;/head&gt;</p>
<p>&lt;body&gt;<br />
&lt;button onclick=&#8221;myFunction()&#8221;&gt;Click me&lt;/button&gt;<br />
&lt;script type=&#8221;text/vbscript&#8221;&gt;<br />
document.write(&#8220;This message is written by VBScript&#8221;)<br />
&lt;/script&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;</p></div>
<p><a href="http://www.w3schools.com/vbscript/tryit.asp?filename=vbdemo_headandbody" target="_blank">Try it yourself »</a></div>
<p>&nbsp;</p>
<hr />
<h2>Using an External VBScript</h2>
<p>If you want to run the same VBScript on several pages, without having to write the same script on every page, you can write a VBScript in an external file.</p>
<p>Save the external VBScript file with a .vbs file extension.</p>
<p><strong>Note:</strong> The external script cannot contain the &lt;script&gt; tag!</p>
<p>To use the external script, point to the .vbs file in the &#8220;src&#8221; attribute of the &lt;script&gt; tag:</p>
<div>
<h2>Example</h2>
<div>&lt;html&gt;<br />
&lt;head&gt;<br />
&lt;script type=&#8221;text/vbscript&#8221; src=&#8221;ex.vbs&#8221;&gt;&lt;/script&gt;<br />
&lt;/head&gt;<br />
&lt;body&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;</div>
<p><a href="http://www.w3schools.com/vbscript/tryit.asp?filename=vbdemo_external" target="_blank">Try it yourself »</a></div>
<p><strong>Note:</strong> Remember to place the script exactly where you normally would write the script!</p>
<p>source from: <a href="http://www.w3schools.com/">w3schools</a></p>



Share and Enjoy:


	<a rel="nofollow"  target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-where-to%2F&amp;title=VBScript%20Where%20To%20...&amp;bodytext=VBScripts%20can%20be%20placed%20in%20the%20body%20and%20in%20the%20head%20section%20of%20an%20HTML%20document.%0D%0A%0D%0A%0D%0A%0D%0AWhere%20to%20Put%20the%20VBScript%0D%0AVBScripts%20in%20a%20page%20will%20be%20executed%20immediately%20while%20the%20page%20loads%20into%20the%20browser.%20This%20is%20not%20always%20what%20we%20want.%20Sometimes%20we%20w" title="Digg"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" /></a>
	<a rel="nofollow"  target="_blank" href="http://sphinn.com/index.php?c=post&amp;m=submit&amp;link=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-where-to%2F" title="Sphinn"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/sphinn.png" title="Sphinn" alt="Sphinn" /></a>
	<a rel="nofollow"  target="_blank" href="http://delicious.com/post?url=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-where-to%2F&amp;title=VBScript%20Where%20To%20...&amp;notes=VBScripts%20can%20be%20placed%20in%20the%20body%20and%20in%20the%20head%20section%20of%20an%20HTML%20document.%0D%0A%0D%0A%0D%0A%0D%0AWhere%20to%20Put%20the%20VBScript%0D%0AVBScripts%20in%20a%20page%20will%20be%20executed%20immediately%20while%20the%20page%20loads%20into%20the%20browser.%20This%20is%20not%20always%20what%20we%20want.%20Sometimes%20we%20w" title="del.icio.us"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-where-to%2F&amp;t=VBScript%20Where%20To%20..." title="Facebook"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.mixx.com/submit?page_url=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-where-to%2F&amp;title=VBScript%20Where%20To%20..." title="Mixx"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/mixx.png" title="Mixx" alt="Mixx" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-where-to%2F&amp;title=VBScript%20Where%20To%20...&amp;annotation=VBScripts%20can%20be%20placed%20in%20the%20body%20and%20in%20the%20head%20section%20of%20an%20HTML%20document.%0D%0A%0D%0A%0D%0A%0D%0AWhere%20to%20Put%20the%20VBScript%0D%0AVBScripts%20in%20a%20page%20will%20be%20executed%20immediately%20while%20the%20page%20loads%20into%20the%20browser.%20This%20is%20not%20always%20what%20we%20want.%20Sometimes%20we%20w" title="Google Bookmarks"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.diigo.com/post?url=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-where-to%2F&amp;title=VBScript%20Where%20To%20..." title="Diigo"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/diigo.png" title="Diigo" alt="Diigo" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.dzone.com/links/add.html?url=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-where-to%2F&amp;title=VBScript%20Where%20To%20..." title="DZone"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/dzone.png" title="DZone" alt="DZone" /></a>
	<a rel="nofollow"  target="_blank" href="http://cgi.fark.com/cgi/fark/farkit.pl?h=VBScript%20Where%20To%20...&amp;u=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-where-to%2F" title="Fark"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/fark.png" title="Fark" alt="Fark" /></a>
	<a rel="nofollow"  target="_blank" href="http://faves.com/Authoring.aspx?u=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-where-to%2F&amp;title=VBScript%20Where%20To%20..." title="Faves"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/bluedot.png" title="Faves" alt="Faves" /></a>
	<a rel="nofollow"  target="_blank" href="http://laaik.it/NewStoryCompact.aspx?uri=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-where-to%2F&amp;headline=VBScript%20Where%20To%20...&amp;cat=5e082fcc-8a3b-47e2-acec-fdf64ff19d12" title="laaik.it"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/laaikit.png" title="laaik.it" alt="laaik.it" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-where-to%2F&amp;title=VBScript%20Where%20To%20...&amp;source=Classifieds+Scripts%2C+Web+Scripts%2C++Ajax+Scripts%2C+PHP+Scripts%2C+ASP+Scripts+AJAX%2C+PHP+Scripts%2C+ASP+Scripts%2C+Ad+Management%2C+Bookmark+Management%2C+Database+Tools%2C+Chat+Scripts%2C+HTML+Editors%2C+Classified+Ads+Scripts%2C+Classifieds+Script&amp;summary=VBScripts%20can%20be%20placed%20in%20the%20body%20and%20in%20the%20head%20section%20of%20an%20HTML%20document.%0D%0A%0D%0A%0D%0A%0D%0AWhere%20to%20Put%20the%20VBScript%0D%0AVBScripts%20in%20a%20page%20will%20be%20executed%20immediately%20while%20the%20page%20loads%20into%20the%20browser.%20This%20is%20not%20always%20what%20we%20want.%20Sometimes%20we%20w" title="LinkedIn"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" /></a>
	<a rel="nofollow"  target="_blank" href="https://favorites.live.com/quickadd.aspx?marklet=1&amp;url=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-where-to%2F&amp;title=VBScript%20Where%20To%20..." title="Live"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/live.png" title="Live" alt="Live" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.mister-wong.com/addurl/?bm_url=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-where-to%2F&amp;bm_description=VBScript%20Where%20To%20...&amp;plugin=soc" title="MisterWong"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/misterwong.png" title="MisterWong" alt="MisterWong" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.myspace.com/Modules/PostTo/Pages/?u=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-where-to%2F&amp;t=VBScript%20Where%20To%20..." title="MySpace"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/myspace.png" title="MySpace" alt="MySpace" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.netvibes.com/share?title=VBScript%20Where%20To%20...&amp;url=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-where-to%2F" title="Netvibes"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/netvibes.png" title="Netvibes" alt="Netvibes" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.netvouz.com/action/submitBookmark?url=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-where-to%2F&amp;title=VBScript%20Where%20To%20...&amp;popup=no" title="Netvouz"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/netvouz.png" title="Netvouz" alt="Netvouz" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.newsvine.com/_tools/seed&amp;save?u=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-where-to%2F&amp;h=VBScript%20Where%20To%20..." title="NewsVine"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/newsvine.png" title="NewsVine" alt="NewsVine" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.propeller.com/submit/?url=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-where-to%2F" title="Propeller"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/propeller.png" title="Propeller" alt="Propeller" /></a>
	<a rel="nofollow"  target="_blank" href="http://reddit.com/submit?url=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-where-to%2F&amp;title=VBScript%20Where%20To%20..." title="Reddit"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" /></a>
	<a rel="nofollow"  target="_blank" href="http://slashdot.org/bookmark.pl?title=VBScript%20Where%20To%20...&amp;url=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-where-to%2F" title="Slashdot"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/slashdot.png" title="Slashdot" alt="Slashdot" /></a>
	<a rel="nofollow"  target="_blank" href="http://socialogs.com/add_story.php?story_url=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-where-to%2F&amp;story_title=VBScript%20Where%20To%20..." title="Socialogs"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/socialogs.png" title="Socialogs" alt="Socialogs" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-where-to%2F&amp;title=VBScript%20Where%20To%20..." title="StumbleUpon"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" /></a>
	<a rel="nofollow"  target="_blank" href="http://technorati.com/faves?add=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-where-to%2F" title="Technorati"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" /></a>
	<a rel="nofollow"  target="_blank" href="http://twitter.com/home?status=VBScript%20Where%20To%20...%20-%20http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-where-to%2F" title="Twitter"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" /></a>
	<a rel="nofollow"  target="_blank" href="http://buzz.yahoo.com/submit/?submitUrl=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-where-to%2F&amp;submitHeadline=VBScript%20Where%20To%20...&amp;submitSummary=VBScripts%20can%20be%20placed%20in%20the%20body%20and%20in%20the%20head%20section%20of%20an%20HTML%20document.%0D%0A%0D%0A%0D%0A%0D%0AWhere%20to%20Put%20the%20VBScript%0D%0AVBScripts%20in%20a%20page%20will%20be%20executed%20immediately%20while%20the%20page%20loads%20into%20the%20browser.%20This%20is%20not%20always%20what%20we%20want.%20Sometimes%20we%20w&amp;submitCategory=science&amp;submitAssetType=text" title="Yahoo! Buzz"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/yahoobuzz.png" title="Yahoo! Buzz" alt="Yahoo! Buzz" /></a>


<br/><br/>]]></content:encoded>
			<wfw:commentRss>http://www.scriptclassifieds.com/vbscript/vbscript-where-to/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>VBScript Variables</title>
		<link>http://www.scriptclassifieds.com/vbscript/vbscript-variables/</link>
		<comments>http://www.scriptclassifieds.com/vbscript/vbscript-variables/#comments</comments>
		<pubDate>Fri, 20 Apr 2012 10:25:36 +0000</pubDate>
		<dc:creator>thanhlangtu</dc:creator>
				<category><![CDATA[VBScript]]></category>
		<category><![CDATA[Variables]]></category>

		<guid isPermaLink="false">http://www.scriptclassifieds.com/?p=1196</guid>
		<description><![CDATA[Variables are &#8220;containers&#8221; for storing information. Do You Remember Algebra from School? Do you remember algebra from school? x=5, y=6, z=x+y Do you remember that a letter (like x) could be used to hold a value (like 5), and that you could use the information above to calculate the value of z to be 11? [...]]]></description>
			<content:encoded><![CDATA[<p>Variables are &#8220;containers&#8221; for storing information.</p>
<hr />
<div>
<h2></h2>
</div>
<hr />
<h2>Do You Remember Algebra from School?</h2>
<p>Do you remember algebra from school? x=5, y=6, z=x+y</p>
<p>Do you remember that a letter (like x) could be used to hold a value (like 5), and that you could use the information above to calculate the value of z to be 11?</p>
<p>These letters are called <strong>variables</strong>, and variables can be used to hold values (x=5) or expressions (z=x+y).</p>
<hr />
<h2>VBScript Variables</h2>
<p>As with algebra, VBScript variables are used to hold values or expressions.</p>
<p>A variable can have a short name, like x, or a more descriptive name, like carname.</p>
<p>Rules for VBScript variable names:</p>
<ul>
<li>Must begin with a letter</li>
<li>Cannot contain a period (.)</li>
<li>Cannot exceed 255 characters</li>
</ul>
<p>In VBScript, all variables are of type <em>variant</em>, that can store different types of data.</p>
<hr />
<h2>Declaring (Creating) VBScript Variables</h2>
<p>Creating variables in VBScript is most often referred to as &#8220;declaring&#8221; variables.</p>
<p>You can declare VBScript variables with the Dim, Public or the Private statement. Like this:</p>
<div>
<div>Dim x<br />
Dim carname</div>
</div>
<p>Now you have created two variables. The name of the variables are &#8220;x&#8221; and &#8220;carname&#8221;.</p>
<p>You can also declare variables by using its name in a script. Like this:</p>
<div>
<div>carname=&#8221;Volvo&#8221;</div>
</div>
<p>Now you have also created a variable. The name of the variable is &#8220;carname&#8221;. However, this method is not a good practice, because you can misspell the variable name later in your script, and that can cause strange results when your script is running.</p>
<p>If you misspell for example the &#8220;carname&#8221; variable to &#8220;carnime&#8221;, the script will automatically create a new variable called &#8220;carnime&#8221;.  To prevent your script from doing this, you can use the Option Explicit statement. This statement forces you to declare all your variables with the dim, public or private statement.</p>
<p>Put the Option Explicit statement on the top of your script. Like this:</p>
<div>
<div>Option Explicit<br />
Dim carname<br />
carname=some value</div>
</div>
<p>&nbsp;</p>
<hr />
<h2>Assigning Values to Variables</h2>
<p>You assign a value to a variable like this:</p>
<div>
<div>carname=&#8221;Volvo&#8221;<br />
x=10</div>
</div>
<p>The variable name is on the left side of the expression and the value you want to assign to the variable is on the right. Now the variable &#8220;carname&#8221; has the value of &#8220;Volvo&#8221;, and the variable &#8220;x&#8221; has the value of &#8220;10&#8243;.</p>
<hr />
<h2>Lifetime of Variables</h2>
<p>How long a variable exists is its lifetime.</p>
<p>When you declare a variable within a procedure, the variable can only be accessed within that procedure. When the procedure exits, the variable is destroyed. These variables are called local variables. You can have local variables with the same name in different procedures, because each is recognized only by the procedure in which it is declared.</p>
<p>If you declare a variable outside a procedure, all the procedures on your page can access it. The lifetime of these variables starts when they are declared, and ends when the page is closed.</p>
<hr />
<h2>VBScript Array Variables</h2>
<p>An array variable is used to store multiple values in a single variable.</p>
<p>In the following example, an array containing 3 elements is declared:</p>
<div>
<div>Dim names(2)</div>
</div>
<p>The number shown in the parentheses is 2. We start at zero so this array contains 3 elements. This is a fixed-size array. You assign data to each of the elements of the array like this:</p>
<div>
<div>names(0)=&#8221;Tove&#8221;<br />
names(1)=&#8221;Jani&#8221;<br />
names(2)=&#8221;Stale&#8221;</div>
</div>
<p>Similarly, the data can be retrieved from any element using the index of the particular array element you want. Like this:</p>
<div>
<div>mother=names(0)</div>
</div>
<p>You can have up to 60 dimensions in an array. Multiple dimensions are declared by separating the numbers in the parentheses with commas. Here we have a two-dimensional array consisting of 5 rows and 7 columns:</p>
<div>
<div>Dim table(4,6)</div>
</div>
<p>Asign data to a two-dimensional array:</p>
<div>
<h2>Example (IE Only)</h2>
<div>&lt;html&gt;<br />
&lt;body&gt;</p>
<p>&lt;script type=&#8221;text/vbscript&#8221;&gt;<br />
Dim x(2,2)<br />
x(0,0)=&#8221;Volvo&#8221;<br />
x(0,1)=&#8221;BMW&#8221;<br />
x(0,2)=&#8221;Ford&#8221;<br />
x(1,0)=&#8221;Apple&#8221;<br />
x(1,1)=&#8221;Orange&#8221;<br />
x(1,2)=&#8221;Banana&#8221;<br />
x(2,0)=&#8221;Coke&#8221;<br />
x(2,1)=&#8221;Pepsi&#8221;<br />
x(2,2)=&#8221;Sprite&#8221;<br />
for i=0 to 2<br />
document.write(&#8220;&lt;p&gt;&#8221;)<br />
for j=0 to 2<br />
document.write(x(i,j) &amp; &#8220;&lt;br /&gt;&#8221;)<br />
next<br />
document.write(&#8220;&lt;/p&gt;&#8221;)<br />
next<br />
&lt;/script&gt;</p>
<p>&lt;/body&gt;<br />
&lt;/html&gt;</p></div>
</div>
<p>source from: <a href="http://www.w3schools.com/">w3schools</a></p>



Share and Enjoy:


	<a rel="nofollow"  target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-variables%2F&amp;title=VBScript%20Variables&amp;bodytext=Variables%20are%20%22containers%22%20for%20storing%20information.%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0ADo%20You%20Remember%20Algebra%20from%20School%3F%0D%0ADo%20you%20remember%20algebra%20from%20school%3F%20x%3D5%2C%20y%3D6%2C%20z%3Dx%2By%0D%0A%0D%0ADo%20you%20remember%20that%20a%20letter%20%28like%20x%29%20could%20be%20used%20to%20hold%20a%20value%20%28like%205%29%2C%20and%20th" title="Digg"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" /></a>
	<a rel="nofollow"  target="_blank" href="http://sphinn.com/index.php?c=post&amp;m=submit&amp;link=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-variables%2F" title="Sphinn"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/sphinn.png" title="Sphinn" alt="Sphinn" /></a>
	<a rel="nofollow"  target="_blank" href="http://delicious.com/post?url=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-variables%2F&amp;title=VBScript%20Variables&amp;notes=Variables%20are%20%22containers%22%20for%20storing%20information.%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0ADo%20You%20Remember%20Algebra%20from%20School%3F%0D%0ADo%20you%20remember%20algebra%20from%20school%3F%20x%3D5%2C%20y%3D6%2C%20z%3Dx%2By%0D%0A%0D%0ADo%20you%20remember%20that%20a%20letter%20%28like%20x%29%20could%20be%20used%20to%20hold%20a%20value%20%28like%205%29%2C%20and%20th" title="del.icio.us"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-variables%2F&amp;t=VBScript%20Variables" title="Facebook"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.mixx.com/submit?page_url=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-variables%2F&amp;title=VBScript%20Variables" title="Mixx"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/mixx.png" title="Mixx" alt="Mixx" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-variables%2F&amp;title=VBScript%20Variables&amp;annotation=Variables%20are%20%22containers%22%20for%20storing%20information.%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0ADo%20You%20Remember%20Algebra%20from%20School%3F%0D%0ADo%20you%20remember%20algebra%20from%20school%3F%20x%3D5%2C%20y%3D6%2C%20z%3Dx%2By%0D%0A%0D%0ADo%20you%20remember%20that%20a%20letter%20%28like%20x%29%20could%20be%20used%20to%20hold%20a%20value%20%28like%205%29%2C%20and%20th" title="Google Bookmarks"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.diigo.com/post?url=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-variables%2F&amp;title=VBScript%20Variables" title="Diigo"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/diigo.png" title="Diigo" alt="Diigo" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.dzone.com/links/add.html?url=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-variables%2F&amp;title=VBScript%20Variables" title="DZone"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/dzone.png" title="DZone" alt="DZone" /></a>
	<a rel="nofollow"  target="_blank" href="http://cgi.fark.com/cgi/fark/farkit.pl?h=VBScript%20Variables&amp;u=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-variables%2F" title="Fark"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/fark.png" title="Fark" alt="Fark" /></a>
	<a rel="nofollow"  target="_blank" href="http://faves.com/Authoring.aspx?u=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-variables%2F&amp;title=VBScript%20Variables" title="Faves"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/bluedot.png" title="Faves" alt="Faves" /></a>
	<a rel="nofollow"  target="_blank" href="http://laaik.it/NewStoryCompact.aspx?uri=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-variables%2F&amp;headline=VBScript%20Variables&amp;cat=5e082fcc-8a3b-47e2-acec-fdf64ff19d12" title="laaik.it"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/laaikit.png" title="laaik.it" alt="laaik.it" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-variables%2F&amp;title=VBScript%20Variables&amp;source=Classifieds+Scripts%2C+Web+Scripts%2C++Ajax+Scripts%2C+PHP+Scripts%2C+ASP+Scripts+AJAX%2C+PHP+Scripts%2C+ASP+Scripts%2C+Ad+Management%2C+Bookmark+Management%2C+Database+Tools%2C+Chat+Scripts%2C+HTML+Editors%2C+Classified+Ads+Scripts%2C+Classifieds+Script&amp;summary=Variables%20are%20%22containers%22%20for%20storing%20information.%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0ADo%20You%20Remember%20Algebra%20from%20School%3F%0D%0ADo%20you%20remember%20algebra%20from%20school%3F%20x%3D5%2C%20y%3D6%2C%20z%3Dx%2By%0D%0A%0D%0ADo%20you%20remember%20that%20a%20letter%20%28like%20x%29%20could%20be%20used%20to%20hold%20a%20value%20%28like%205%29%2C%20and%20th" title="LinkedIn"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" /></a>
	<a rel="nofollow"  target="_blank" href="https://favorites.live.com/quickadd.aspx?marklet=1&amp;url=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-variables%2F&amp;title=VBScript%20Variables" title="Live"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/live.png" title="Live" alt="Live" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.mister-wong.com/addurl/?bm_url=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-variables%2F&amp;bm_description=VBScript%20Variables&amp;plugin=soc" title="MisterWong"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/misterwong.png" title="MisterWong" alt="MisterWong" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.myspace.com/Modules/PostTo/Pages/?u=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-variables%2F&amp;t=VBScript%20Variables" title="MySpace"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/myspace.png" title="MySpace" alt="MySpace" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.netvibes.com/share?title=VBScript%20Variables&amp;url=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-variables%2F" title="Netvibes"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/netvibes.png" title="Netvibes" alt="Netvibes" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.netvouz.com/action/submitBookmark?url=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-variables%2F&amp;title=VBScript%20Variables&amp;popup=no" title="Netvouz"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/netvouz.png" title="Netvouz" alt="Netvouz" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.newsvine.com/_tools/seed&amp;save?u=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-variables%2F&amp;h=VBScript%20Variables" title="NewsVine"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/newsvine.png" title="NewsVine" alt="NewsVine" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.propeller.com/submit/?url=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-variables%2F" title="Propeller"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/propeller.png" title="Propeller" alt="Propeller" /></a>
	<a rel="nofollow"  target="_blank" href="http://reddit.com/submit?url=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-variables%2F&amp;title=VBScript%20Variables" title="Reddit"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" /></a>
	<a rel="nofollow"  target="_blank" href="http://slashdot.org/bookmark.pl?title=VBScript%20Variables&amp;url=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-variables%2F" title="Slashdot"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/slashdot.png" title="Slashdot" alt="Slashdot" /></a>
	<a rel="nofollow"  target="_blank" href="http://socialogs.com/add_story.php?story_url=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-variables%2F&amp;story_title=VBScript%20Variables" title="Socialogs"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/socialogs.png" title="Socialogs" alt="Socialogs" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-variables%2F&amp;title=VBScript%20Variables" title="StumbleUpon"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" /></a>
	<a rel="nofollow"  target="_blank" href="http://technorati.com/faves?add=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-variables%2F" title="Technorati"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" /></a>
	<a rel="nofollow"  target="_blank" href="http://twitter.com/home?status=VBScript%20Variables%20-%20http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-variables%2F" title="Twitter"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" /></a>
	<a rel="nofollow"  target="_blank" href="http://buzz.yahoo.com/submit/?submitUrl=http%3A%2F%2Fwww.scriptclassifieds.com%2Fvbscript%2Fvbscript-variables%2F&amp;submitHeadline=VBScript%20Variables&amp;submitSummary=Variables%20are%20%22containers%22%20for%20storing%20information.%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0A%0D%0ADo%20You%20Remember%20Algebra%20from%20School%3F%0D%0ADo%20you%20remember%20algebra%20from%20school%3F%20x%3D5%2C%20y%3D6%2C%20z%3Dx%2By%0D%0A%0D%0ADo%20you%20remember%20that%20a%20letter%20%28like%20x%29%20could%20be%20used%20to%20hold%20a%20value%20%28like%205%29%2C%20and%20th&amp;submitCategory=science&amp;submitAssetType=text" title="Yahoo! Buzz"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/yahoobuzz.png" title="Yahoo! Buzz" alt="Yahoo! Buzz" /></a>


<br/><br/>]]></content:encoded>
			<wfw:commentRss>http://www.scriptclassifieds.com/vbscript/vbscript-variables/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ASP Session Object</title>
		<link>http://www.scriptclassifieds.com/asp/asp-session-object/</link>
		<comments>http://www.scriptclassifieds.com/asp/asp-session-object/#comments</comments>
		<pubDate>Fri, 30 Mar 2012 16:15:25 +0000</pubDate>
		<dc:creator>thanhlangtu</dc:creator>
				<category><![CDATA[ASP]]></category>
		<category><![CDATA[Object]]></category>
		<category><![CDATA[Session]]></category>

		<guid isPermaLink="false">http://www.scriptclassifieds.com/?p=1185</guid>
		<description><![CDATA[<a href="http://www.scriptclassifieds.com/asp/asp-session-object/"><img align="left" hspace="5" width="100" src="http://www.w3schools.com/asp/lamp.gif" class="alignleft wp-post-image tfe" alt="Tip" title="" /></a>A Session object stores information about, or change settings for a user session. The Session object When you are working with an application on your computer, you open it, do some changes and then you close it. This is much like a Session. The computer knows who you are. It knows when you open the [...]]]></description>
			<content:encoded><![CDATA[<p>A Session object stores information about, or change settings for a user session.</p>
<hr />
<h2>The Session object</h2>
<p>When you are working with an application on your computer, you open it, do some changes and then you close it. This is much like a Session. The computer knows who you are. It knows when you open the application and when you close it. However, on the internet there is one problem: the web server does not know who you are and what you do, because the HTTP address doesn&#8217;t maintain state.</p>
<p>ASP solves this problem by creating a unique cookie for each user. The cookie is sent to the user&#8217;s computer and it contains information that identifies the user. This interface is called the Session object.</p>
<p>The Session object stores information about, or change settings for a user session.</p>
<p>Variables stored in a Session object hold information about one single user, and are available to all pages in one application. Common information stored in session variables are name, id, and preferences. The server creates a new Session object for each new user, and destroys the Session object when the session expires.</p>
<hr />
<h2>When does a Session Start?</h2>
<p>A session starts when:</p>
<ul>
<li>A new user requests an ASP file, and the Global.asa file includes a Session_OnStart procedure</li>
<li>A value is stored in a Session variable</li>
<li>A user requests an ASP file, and the Global.asa file uses the &lt;object&gt; tag to instantiate an object with session scope</li>
</ul>
<hr />
<h2>When does a Session End?</h2>
<p>A session ends if a user has not requested or refreshed a page in the application for a specified period. By default, this is 20 minutes.</p>
<p>If you want to set a timeout interval that is shorter or longer than the default, use the <strong>Timeout</strong>property.</p>
<p>The example below sets a timeout interval of 5 minutes:</p>
<div>
<div>&lt;%<br />
Session.Timeout=5<br />
%&gt;</div>
</div>
<p>Use the <strong>Abandon</strong> method to end a session immediately:</p>
<div>
<div>&lt;%<br />
Session.Abandon<br />
%&gt;</div>
</div>
<p><strong>Note:</strong> The main problem with sessions is WHEN they should end. We do not know if the user&#8217;s last request was the final one or not. So we do not know how long we should keep the session &#8220;alive&#8221;. Waiting too long for an idle session uses up resources on the server, but if the session is deleted too soon the user has to start all over again because the server has deleted all the information. Finding the right timeout interval can be difficult!</p>
<p><img src="http://www.w3schools.com/asp/lamp.gif" alt="Tip" /> <strong>Tip:</strong> Only store SMALL amounts of data in session variables!</p>
<hr />
<h2>Store and Retrieve Session Variables</h2>
<p>The most important thing about the Session object is that you can store variables in it.</p>
<p>The example below will set the Session variable <em>username</em> to &#8220;Donald Duck&#8221; and the Session variable <em>age</em> to &#8220;50&#8243;:</p>
<div>
<div>&lt;%<br />
Session(&#8220;username&#8221;)=&#8221;Donald Duck&#8221;<br />
Session(&#8220;age&#8221;)=50<br />
%&gt;</div>
</div>
<p>When the value is stored in a session variable it can be reached from ANY page in the ASP application:</p>
<div>
<div>Welcome &lt;%Response.Write(Session(&#8220;username&#8221;))%&gt;</div>
</div>
<p>The line above returns: &#8220;Welcome Donald Duck&#8221;.</p>
<p>You can also store user preferences in the Session object, and then access that preference to choose what page to return to the user.</p>
<p>The example below specifies a text-only version of the page if the user has a low screen resolution:</p>
<div>
<div>&lt;%If Session(&#8220;screenres&#8221;)=&#8221;low&#8221; Then%&gt;<br />
This is the text version of the page<br />
&lt;%Else%&gt;<br />
This is the multimedia version of the page<br />
&lt;%End If%&gt;</div>
</div>
<p>&nbsp;</p>
<hr />
<h2>Remove Session Variables</h2>
<p>The Contents collection contains all session variables.</p>
<p>It is possible to remove a session variable with the Remove method.</p>
<p>The example below removes the session variable &#8220;sale&#8221; if the value of the session variable &#8220;age&#8221; is lower than 18:</p>
<div>
<div>&lt;%<br />
If Session.Contents(&#8220;age&#8221;)&lt;18 then<br />
Session.Contents.Remove(&#8220;sale&#8221;)<br />
End If<br />
%&gt;</div>
</div>
<p>To remove all variables in a session, use the RemoveAll method:</p>
<div>
<div>&lt;%<br />
Session.Contents.RemoveAll()<br />
%&gt;</div>
</div>
<p>&nbsp;</p>
<hr />
<h2>Loop Through the Contents Collection</h2>
<p>The Contents collection contains all session variables. You can loop through the Contents collection, to see what&#8217;s stored in it:</p>
<div>
<div>&lt;%<br />
Session(&#8220;username&#8221;)=&#8221;Donald Duck&#8221;<br />
Session(&#8220;age&#8221;)=50</p>
<p>dim i<br />
For Each i in Session.Contents<br />
Response.Write(i &amp; &#8220;&lt;br /&gt;&#8221;)<br />
Next<br />
%&gt;</p></div>
</div>
<p>Result:</p>
<div>
<div>username<br />
age</div>
</div>
<p>If you do not know the number of items in the Contents collection, you can use the Count property:</p>
<div>
<div>&lt;%<br />
dim i<br />
dim j<br />
j=Session.Contents.Count<br />
Response.Write(&#8220;Session variables: &#8221; &amp; j)<br />
For i=1 to j<br />
Response.Write(Session.Contents(i) &amp; &#8220;&lt;br /&gt;&#8221;)<br />
Next<br />
%&gt;</div>
</div>
<p>Result:</p>
<div>
<div>Session variables: 2<br />
Donald Duck<br />
50</div>
</div>
<p>&nbsp;</p>
<hr />
<h2>Loop Through the StaticObjects Collection</h2>
<p>You can loop through the StaticObjects collection, to see the values of all objects stored in the Session object:</p>
<div>
<div>&lt;%<br />
dim i<br />
For Each i in Session.StaticObjects<br />
Response.Write(i &amp; &#8220;&lt;br /&gt;&#8221;)<br />
Next<br />
%&gt;</div>
</div>
<p>source from: <a href="http://www.w3schools.com/">w3schools</a></p>



Share and Enjoy:


	<a rel="nofollow"  target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.scriptclassifieds.com%2Fasp%2Fasp-session-object%2F&amp;title=ASP%20Session%20Object&amp;bodytext=A%20Session%20object%20stores%20information%20about%2C%20or%20change%20settings%20for%20a%20user%20session.%0D%0A%0D%0A%0D%0A%0D%0AThe%20Session%20object%0D%0AWhen%20you%20are%20working%20with%20an%20application%20on%20your%20computer%2C%20you%20open%20it%2C%20do%20some%20changes%20and%20then%20you%20close%20it.%20This%20is%20much%20like%20a%20Session.%20T" title="Digg"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" /></a>
	<a rel="nofollow"  target="_blank" href="http://sphinn.com/index.php?c=post&amp;m=submit&amp;link=http%3A%2F%2Fwww.scriptclassifieds.com%2Fasp%2Fasp-session-object%2F" title="Sphinn"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/sphinn.png" title="Sphinn" alt="Sphinn" /></a>
	<a rel="nofollow"  target="_blank" href="http://delicious.com/post?url=http%3A%2F%2Fwww.scriptclassifieds.com%2Fasp%2Fasp-session-object%2F&amp;title=ASP%20Session%20Object&amp;notes=A%20Session%20object%20stores%20information%20about%2C%20or%20change%20settings%20for%20a%20user%20session.%0D%0A%0D%0A%0D%0A%0D%0AThe%20Session%20object%0D%0AWhen%20you%20are%20working%20with%20an%20application%20on%20your%20computer%2C%20you%20open%20it%2C%20do%20some%20changes%20and%20then%20you%20close%20it.%20This%20is%20much%20like%20a%20Session.%20T" title="del.icio.us"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.scriptclassifieds.com%2Fasp%2Fasp-session-object%2F&amp;t=ASP%20Session%20Object" title="Facebook"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.mixx.com/submit?page_url=http%3A%2F%2Fwww.scriptclassifieds.com%2Fasp%2Fasp-session-object%2F&amp;title=ASP%20Session%20Object" title="Mixx"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/mixx.png" title="Mixx" alt="Mixx" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fwww.scriptclassifieds.com%2Fasp%2Fasp-session-object%2F&amp;title=ASP%20Session%20Object&amp;annotation=A%20Session%20object%20stores%20information%20about%2C%20or%20change%20settings%20for%20a%20user%20session.%0D%0A%0D%0A%0D%0A%0D%0AThe%20Session%20object%0D%0AWhen%20you%20are%20working%20with%20an%20application%20on%20your%20computer%2C%20you%20open%20it%2C%20do%20some%20changes%20and%20then%20you%20close%20it.%20This%20is%20much%20like%20a%20Session.%20T" title="Google Bookmarks"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.diigo.com/post?url=http%3A%2F%2Fwww.scriptclassifieds.com%2Fasp%2Fasp-session-object%2F&amp;title=ASP%20Session%20Object" title="Diigo"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/diigo.png" title="Diigo" alt="Diigo" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.dzone.com/links/add.html?url=http%3A%2F%2Fwww.scriptclassifieds.com%2Fasp%2Fasp-session-object%2F&amp;title=ASP%20Session%20Object" title="DZone"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/dzone.png" title="DZone" alt="DZone" /></a>
	<a rel="nofollow"  target="_blank" href="http://cgi.fark.com/cgi/fark/farkit.pl?h=ASP%20Session%20Object&amp;u=http%3A%2F%2Fwww.scriptclassifieds.com%2Fasp%2Fasp-session-object%2F" title="Fark"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/fark.png" title="Fark" alt="Fark" /></a>
	<a rel="nofollow"  target="_blank" href="http://faves.com/Authoring.aspx?u=http%3A%2F%2Fwww.scriptclassifieds.com%2Fasp%2Fasp-session-object%2F&amp;title=ASP%20Session%20Object" title="Faves"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/bluedot.png" title="Faves" alt="Faves" /></a>
	<a rel="nofollow"  target="_blank" href="http://laaik.it/NewStoryCompact.aspx?uri=http%3A%2F%2Fwww.scriptclassifieds.com%2Fasp%2Fasp-session-object%2F&amp;headline=ASP%20Session%20Object&amp;cat=5e082fcc-8a3b-47e2-acec-fdf64ff19d12" title="laaik.it"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/laaikit.png" title="laaik.it" alt="laaik.it" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fwww.scriptclassifieds.com%2Fasp%2Fasp-session-object%2F&amp;title=ASP%20Session%20Object&amp;source=Classifieds+Scripts%2C+Web+Scripts%2C++Ajax+Scripts%2C+PHP+Scripts%2C+ASP+Scripts+AJAX%2C+PHP+Scripts%2C+ASP+Scripts%2C+Ad+Management%2C+Bookmark+Management%2C+Database+Tools%2C+Chat+Scripts%2C+HTML+Editors%2C+Classified+Ads+Scripts%2C+Classifieds+Script&amp;summary=A%20Session%20object%20stores%20information%20about%2C%20or%20change%20settings%20for%20a%20user%20session.%0D%0A%0D%0A%0D%0A%0D%0AThe%20Session%20object%0D%0AWhen%20you%20are%20working%20with%20an%20application%20on%20your%20computer%2C%20you%20open%20it%2C%20do%20some%20changes%20and%20then%20you%20close%20it.%20This%20is%20much%20like%20a%20Session.%20T" title="LinkedIn"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" /></a>
	<a rel="nofollow"  target="_blank" href="https://favorites.live.com/quickadd.aspx?marklet=1&amp;url=http%3A%2F%2Fwww.scriptclassifieds.com%2Fasp%2Fasp-session-object%2F&amp;title=ASP%20Session%20Object" title="Live"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/live.png" title="Live" alt="Live" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.mister-wong.com/addurl/?bm_url=http%3A%2F%2Fwww.scriptclassifieds.com%2Fasp%2Fasp-session-object%2F&amp;bm_description=ASP%20Session%20Object&amp;plugin=soc" title="MisterWong"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/misterwong.png" title="MisterWong" alt="MisterWong" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.myspace.com/Modules/PostTo/Pages/?u=http%3A%2F%2Fwww.scriptclassifieds.com%2Fasp%2Fasp-session-object%2F&amp;t=ASP%20Session%20Object" title="MySpace"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/myspace.png" title="MySpace" alt="MySpace" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.netvibes.com/share?title=ASP%20Session%20Object&amp;url=http%3A%2F%2Fwww.scriptclassifieds.com%2Fasp%2Fasp-session-object%2F" title="Netvibes"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/netvibes.png" title="Netvibes" alt="Netvibes" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.netvouz.com/action/submitBookmark?url=http%3A%2F%2Fwww.scriptclassifieds.com%2Fasp%2Fasp-session-object%2F&amp;title=ASP%20Session%20Object&amp;popup=no" title="Netvouz"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/netvouz.png" title="Netvouz" alt="Netvouz" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.newsvine.com/_tools/seed&amp;save?u=http%3A%2F%2Fwww.scriptclassifieds.com%2Fasp%2Fasp-session-object%2F&amp;h=ASP%20Session%20Object" title="NewsVine"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/newsvine.png" title="NewsVine" alt="NewsVine" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.propeller.com/submit/?url=http%3A%2F%2Fwww.scriptclassifieds.com%2Fasp%2Fasp-session-object%2F" title="Propeller"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/propeller.png" title="Propeller" alt="Propeller" /></a>
	<a rel="nofollow"  target="_blank" href="http://reddit.com/submit?url=http%3A%2F%2Fwww.scriptclassifieds.com%2Fasp%2Fasp-session-object%2F&amp;title=ASP%20Session%20Object" title="Reddit"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" /></a>
	<a rel="nofollow"  target="_blank" href="http://slashdot.org/bookmark.pl?title=ASP%20Session%20Object&amp;url=http%3A%2F%2Fwww.scriptclassifieds.com%2Fasp%2Fasp-session-object%2F" title="Slashdot"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/slashdot.png" title="Slashdot" alt="Slashdot" /></a>
	<a rel="nofollow"  target="_blank" href="http://socialogs.com/add_story.php?story_url=http%3A%2F%2Fwww.scriptclassifieds.com%2Fasp%2Fasp-session-object%2F&amp;story_title=ASP%20Session%20Object" title="Socialogs"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/socialogs.png" title="Socialogs" alt="Socialogs" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.scriptclassifieds.com%2Fasp%2Fasp-session-object%2F&amp;title=ASP%20Session%20Object" title="StumbleUpon"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" /></a>
	<a rel="nofollow"  target="_blank" href="http://technorati.com/faves?add=http%3A%2F%2Fwww.scriptclassifieds.com%2Fasp%2Fasp-session-object%2F" title="Technorati"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" /></a>
	<a rel="nofollow"  target="_blank" href="http://twitter.com/home?status=ASP%20Session%20Object%20-%20http%3A%2F%2Fwww.scriptclassifieds.com%2Fasp%2Fasp-session-object%2F" title="Twitter"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" /></a>
	<a rel="nofollow"  target="_blank" href="http://buzz.yahoo.com/submit/?submitUrl=http%3A%2F%2Fwww.scriptclassifieds.com%2Fasp%2Fasp-session-object%2F&amp;submitHeadline=ASP%20Session%20Object&amp;submitSummary=A%20Session%20object%20stores%20information%20about%2C%20or%20change%20settings%20for%20a%20user%20session.%0D%0A%0D%0A%0D%0A%0D%0AThe%20Session%20object%0D%0AWhen%20you%20are%20working%20with%20an%20application%20on%20your%20computer%2C%20you%20open%20it%2C%20do%20some%20changes%20and%20then%20you%20close%20it.%20This%20is%20much%20like%20a%20Session.%20T&amp;submitCategory=science&amp;submitAssetType=text" title="Yahoo! Buzz"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/yahoobuzz.png" title="Yahoo! Buzz" alt="Yahoo! Buzz" /></a>


<br/><br/>]]></content:encoded>
			<wfw:commentRss>http://www.scriptclassifieds.com/asp/asp-session-object/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ASP Including Files</title>
		<link>http://www.scriptclassifieds.com/asp/asp-including-files/</link>
		<comments>http://www.scriptclassifieds.com/asp/asp-including-files/#comments</comments>
		<pubDate>Fri, 30 Mar 2012 16:15:24 +0000</pubDate>
		<dc:creator>thanhlangtu</dc:creator>
				<category><![CDATA[ASP]]></category>
		<category><![CDATA[Including Files]]></category>

		<guid isPermaLink="false">http://www.scriptclassifieds.com/?p=1187</guid>
		<description><![CDATA[You can insert the content of one ASP file into another ASP file before the server executes it, with the #include directive. The #include directive is used to create functions, headers, footers, or elements that will be reused on multiple pages. How to Use the #include Directive Here is a file called &#8220;mypage.asp&#8221;: &#60;html&#62; &#60;body&#62; [...]]]></description>
			<content:encoded><![CDATA[<p>You can insert the content of one ASP file into another ASP file before the server executes it, with the #include directive.</p>
<p>The #include directive is used to create functions, headers, footers, or elements that will be reused on multiple pages.</p>
<hr />
<h2>How to Use the #include Directive</h2>
<p>Here is a file called &#8220;mypage.asp&#8221;:</p>
<div>
<div>&lt;html&gt;<br />
&lt;body&gt;<br />
&lt;h3&gt;Words of Wisdom:&lt;/h3&gt;<br />
&lt;p&gt;&lt;!&#8211;#include file=&#8221;wisdom.inc&#8221;&#8211;&gt;&lt;/p&gt;<br />
&lt;h3&gt;The time is:&lt;/h3&gt;<br />
&lt;p&gt;&lt;!&#8211;#include file=&#8221;time.inc&#8221;&#8211;&gt;&lt;/p&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;</div>
</div>
<p>Here is the &#8220;wisdom.inc&#8221; file:</p>
<div>
<div>&#8220;One should never increase, beyond what is necessary,<br />
the number of entities required to explain anything.&#8221;</div>
</div>
<p>Here is the &#8220;time.inc&#8221; file:</p>
<div>
<div>&lt;%<br />
Response.Write(Time)<br />
%&gt;</div>
</div>
<p>If you look at the source code in a browser, it will look something like this:</p>
<div>
<div>&lt;html&gt;<br />
&lt;body&gt;<br />
&lt;h3&gt;Words of Wisdom:&lt;/h3&gt;<br />
&lt;p&gt;&#8221;One should never increase, beyond what is necessary,<br />
the number of entities required to explain anything.&#8221;&lt;/p&gt;<br />
&lt;h3&gt;The time is:&lt;/h3&gt;<br />
&lt;p&gt;11:33:42 AM&lt;/p&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;</div>
</div>
<p>&nbsp;</p>
<hr />
<h2>Syntax for Including Files</h2>
<p>To include a file in an ASP page, place the #include directive inside comment tags:</p>
<div>
<div>&lt;!&#8211;#include virtual=&#8221;somefilename&#8221;&#8211;&gt;</p>
<p>or</p>
<p>&lt;!&#8211;#include file =&#8221;somefilename&#8221;&#8211;&gt;</p></div>
</div>
<h3>The Virtual Keyword</h3>
<p>Use the virtual keyword to indicate a path beginning with a virtual directory.</p>
<p>If a file named &#8220;header.inc&#8221; resides in a virtual directory named /html, the following line would insert the contents of &#8220;header.inc&#8221;:</p>
<div>
<div>&lt;!&#8211; #include virtual =&#8221;/html/header.inc&#8221; &#8211;&gt;</div>
</div>
<h3>The File Keyword</h3>
<p>Use the file keyword to indicate a relative path. A relative path begins with the directory that contains the including file.</p>
<p>If you have a file in the html directory, and the file &#8220;header.inc&#8221; resides in html\headers, the following line would insert &#8220;header.inc&#8221; in your file:</p>
<div>
<div>&lt;!&#8211; #include file =&#8221;headers\header.inc&#8221; &#8211;&gt;</div>
</div>
<p>Note that the path to the included file (headers\header.inc) is relative to the including file. If the file containing this #include statement is not in the html directory, the statement will not work.</p>
<hr />
<h2>Tips and Notes</h2>
<p>In the sections above we have used the file extension &#8220;.inc&#8221; for included files. Notice that if a user tries to browse an INC file directly, its content will be displayed. If your included file contains confidential information or information you do not want any users to see, it is better to use an ASP extension. The source code in an ASP file will not be visible after the interpretation. An included file can also include other files, and one ASP file can include the same file more than once.</p>
<p><strong>Important:</strong> Included files are processed and inserted before the scripts are executed. The following script will NOT work because ASP executes the #include directive before it assigns a value to the variable:</p>
<div>
<div>&lt;%<br />
fname=&#8221;header.inc&#8221;<br />
%&gt;<br />
&lt;!&#8211;#include file=&#8221;&lt;%fname%&gt;&#8221;&#8211;&gt;</div>
</div>
<p>You cannot open or close a script delimiter in an INC file. The following script will NOT work:</p>
<div>
<div>&lt;%<br />
For i = 1 To n<br />
&lt;!&#8211;#include file=&#8221;count.inc&#8221;&#8211;&gt;<br />
Next<br />
%&gt;</div>
</div>
<p>But this script will work:</p>
<div>
<div>&lt;% For i = 1 to n %&gt;<br />
&lt;!&#8211;#include file=&#8221;count.inc&#8221; &#8211;&gt;<br />
&lt;% Next %&gt;</div>
</div>
<p>source from: <a href="http://www.w3schools.com/">w3schools</a></p>



Share and Enjoy:


	<a rel="nofollow"  target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.scriptclassifieds.com%2Fasp%2Fasp-including-files%2F&amp;title=ASP%20Including%20Files&amp;bodytext=You%20can%20insert%20the%20content%20of%20one%20ASP%20file%20into%20another%20ASP%20file%20before%20the%20server%20executes%20it%2C%20with%20the%20%23include%20directive.%0D%0A%0D%0AThe%20%23include%20directive%20is%20used%20to%20create%20functions%2C%20headers%2C%20footers%2C%20or%20elements%20that%20will%20be%20reused%20on%20multiple%20pages.%0D%0A" title="Digg"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" /></a>
	<a rel="nofollow"  target="_blank" href="http://sphinn.com/index.php?c=post&amp;m=submit&amp;link=http%3A%2F%2Fwww.scriptclassifieds.com%2Fasp%2Fasp-including-files%2F" title="Sphinn"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/sphinn.png" title="Sphinn" alt="Sphinn" /></a>
	<a rel="nofollow"  target="_blank" href="http://delicious.com/post?url=http%3A%2F%2Fwww.scriptclassifieds.com%2Fasp%2Fasp-including-files%2F&amp;title=ASP%20Including%20Files&amp;notes=You%20can%20insert%20the%20content%20of%20one%20ASP%20file%20into%20another%20ASP%20file%20before%20the%20server%20executes%20it%2C%20with%20the%20%23include%20directive.%0D%0A%0D%0AThe%20%23include%20directive%20is%20used%20to%20create%20functions%2C%20headers%2C%20footers%2C%20or%20elements%20that%20will%20be%20reused%20on%20multiple%20pages.%0D%0A" title="del.icio.us"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.scriptclassifieds.com%2Fasp%2Fasp-including-files%2F&amp;t=ASP%20Including%20Files" title="Facebook"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.mixx.com/submit?page_url=http%3A%2F%2Fwww.scriptclassifieds.com%2Fasp%2Fasp-including-files%2F&amp;title=ASP%20Including%20Files" title="Mixx"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/mixx.png" title="Mixx" alt="Mixx" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fwww.scriptclassifieds.com%2Fasp%2Fasp-including-files%2F&amp;title=ASP%20Including%20Files&amp;annotation=You%20can%20insert%20the%20content%20of%20one%20ASP%20file%20into%20another%20ASP%20file%20before%20the%20server%20executes%20it%2C%20with%20the%20%23include%20directive.%0D%0A%0D%0AThe%20%23include%20directive%20is%20used%20to%20create%20functions%2C%20headers%2C%20footers%2C%20or%20elements%20that%20will%20be%20reused%20on%20multiple%20pages.%0D%0A" title="Google Bookmarks"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.diigo.com/post?url=http%3A%2F%2Fwww.scriptclassifieds.com%2Fasp%2Fasp-including-files%2F&amp;title=ASP%20Including%20Files" title="Diigo"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/diigo.png" title="Diigo" alt="Diigo" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.dzone.com/links/add.html?url=http%3A%2F%2Fwww.scriptclassifieds.com%2Fasp%2Fasp-including-files%2F&amp;title=ASP%20Including%20Files" title="DZone"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/dzone.png" title="DZone" alt="DZone" /></a>
	<a rel="nofollow"  target="_blank" href="http://cgi.fark.com/cgi/fark/farkit.pl?h=ASP%20Including%20Files&amp;u=http%3A%2F%2Fwww.scriptclassifieds.com%2Fasp%2Fasp-including-files%2F" title="Fark"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/fark.png" title="Fark" alt="Fark" /></a>
	<a rel="nofollow"  target="_blank" href="http://faves.com/Authoring.aspx?u=http%3A%2F%2Fwww.scriptclassifieds.com%2Fasp%2Fasp-including-files%2F&amp;title=ASP%20Including%20Files" title="Faves"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/bluedot.png" title="Faves" alt="Faves" /></a>
	<a rel="nofollow"  target="_blank" href="http://laaik.it/NewStoryCompact.aspx?uri=http%3A%2F%2Fwww.scriptclassifieds.com%2Fasp%2Fasp-including-files%2F&amp;headline=ASP%20Including%20Files&amp;cat=5e082fcc-8a3b-47e2-acec-fdf64ff19d12" title="laaik.it"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/laaikit.png" title="laaik.it" alt="laaik.it" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fwww.scriptclassifieds.com%2Fasp%2Fasp-including-files%2F&amp;title=ASP%20Including%20Files&amp;source=Classifieds+Scripts%2C+Web+Scripts%2C++Ajax+Scripts%2C+PHP+Scripts%2C+ASP+Scripts+AJAX%2C+PHP+Scripts%2C+ASP+Scripts%2C+Ad+Management%2C+Bookmark+Management%2C+Database+Tools%2C+Chat+Scripts%2C+HTML+Editors%2C+Classified+Ads+Scripts%2C+Classifieds+Script&amp;summary=You%20can%20insert%20the%20content%20of%20one%20ASP%20file%20into%20another%20ASP%20file%20before%20the%20server%20executes%20it%2C%20with%20the%20%23include%20directive.%0D%0A%0D%0AThe%20%23include%20directive%20is%20used%20to%20create%20functions%2C%20headers%2C%20footers%2C%20or%20elements%20that%20will%20be%20reused%20on%20multiple%20pages.%0D%0A" title="LinkedIn"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" /></a>
	<a rel="nofollow"  target="_blank" href="https://favorites.live.com/quickadd.aspx?marklet=1&amp;url=http%3A%2F%2Fwww.scriptclassifieds.com%2Fasp%2Fasp-including-files%2F&amp;title=ASP%20Including%20Files" title="Live"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/live.png" title="Live" alt="Live" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.mister-wong.com/addurl/?bm_url=http%3A%2F%2Fwww.scriptclassifieds.com%2Fasp%2Fasp-including-files%2F&amp;bm_description=ASP%20Including%20Files&amp;plugin=soc" title="MisterWong"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/misterwong.png" title="MisterWong" alt="MisterWong" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.myspace.com/Modules/PostTo/Pages/?u=http%3A%2F%2Fwww.scriptclassifieds.com%2Fasp%2Fasp-including-files%2F&amp;t=ASP%20Including%20Files" title="MySpace"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/myspace.png" title="MySpace" alt="MySpace" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.netvibes.com/share?title=ASP%20Including%20Files&amp;url=http%3A%2F%2Fwww.scriptclassifieds.com%2Fasp%2Fasp-including-files%2F" title="Netvibes"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/netvibes.png" title="Netvibes" alt="Netvibes" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.netvouz.com/action/submitBookmark?url=http%3A%2F%2Fwww.scriptclassifieds.com%2Fasp%2Fasp-including-files%2F&amp;title=ASP%20Including%20Files&amp;popup=no" title="Netvouz"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/netvouz.png" title="Netvouz" alt="Netvouz" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.newsvine.com/_tools/seed&amp;save?u=http%3A%2F%2Fwww.scriptclassifieds.com%2Fasp%2Fasp-including-files%2F&amp;h=ASP%20Including%20Files" title="NewsVine"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/newsvine.png" title="NewsVine" alt="NewsVine" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.propeller.com/submit/?url=http%3A%2F%2Fwww.scriptclassifieds.com%2Fasp%2Fasp-including-files%2F" title="Propeller"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/propeller.png" title="Propeller" alt="Propeller" /></a>
	<a rel="nofollow"  target="_blank" href="http://reddit.com/submit?url=http%3A%2F%2Fwww.scriptclassifieds.com%2Fasp%2Fasp-including-files%2F&amp;title=ASP%20Including%20Files" title="Reddit"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" /></a>
	<a rel="nofollow"  target="_blank" href="http://slashdot.org/bookmark.pl?title=ASP%20Including%20Files&amp;url=http%3A%2F%2Fwww.scriptclassifieds.com%2Fasp%2Fasp-including-files%2F" title="Slashdot"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/slashdot.png" title="Slashdot" alt="Slashdot" /></a>
	<a rel="nofollow"  target="_blank" href="http://socialogs.com/add_story.php?story_url=http%3A%2F%2Fwww.scriptclassifieds.com%2Fasp%2Fasp-including-files%2F&amp;story_title=ASP%20Including%20Files" title="Socialogs"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/socialogs.png" title="Socialogs" alt="Socialogs" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.scriptclassifieds.com%2Fasp%2Fasp-including-files%2F&amp;title=ASP%20Including%20Files" title="StumbleUpon"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" /></a>
	<a rel="nofollow"  target="_blank" href="http://technorati.com/faves?add=http%3A%2F%2Fwww.scriptclassifieds.com%2Fasp%2Fasp-including-files%2F" title="Technorati"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" /></a>
	<a rel="nofollow"  target="_blank" href="http://twitter.com/home?status=ASP%20Including%20Files%20-%20http%3A%2F%2Fwww.scriptclassifieds.com%2Fasp%2Fasp-including-files%2F" title="Twitter"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" /></a>
	<a rel="nofollow"  target="_blank" href="http://buzz.yahoo.com/submit/?submitUrl=http%3A%2F%2Fwww.scriptclassifieds.com%2Fasp%2Fasp-including-files%2F&amp;submitHeadline=ASP%20Including%20Files&amp;submitSummary=You%20can%20insert%20the%20content%20of%20one%20ASP%20file%20into%20another%20ASP%20file%20before%20the%20server%20executes%20it%2C%20with%20the%20%23include%20directive.%0D%0A%0D%0AThe%20%23include%20directive%20is%20used%20to%20create%20functions%2C%20headers%2C%20footers%2C%20or%20elements%20that%20will%20be%20reused%20on%20multiple%20pages.%0D%0A&amp;submitCategory=science&amp;submitAssetType=text" title="Yahoo! Buzz"><img src="http://www.scriptclassifieds.com/wp-content/plugins/sociable/images/yahoobuzz.png" title="Yahoo! Buzz" alt="Yahoo! Buzz" /></a>


<br/><br/>]]></content:encoded>
			<wfw:commentRss>http://www.scriptclassifieds.com/asp/asp-including-files/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

